From 3e9cc77bf1b73429d7497298350ad2c996d27202 Mon Sep 17 00:00:00 2001 From: daihere1993 Date: Wed, 20 Aug 2025 14:56:04 +0800 Subject: [PATCH 1/5] fix: two flaky tests --- test/snapshots/mac/macArchiveTest.js.snap | 20 +-- test/snapshots/mac/macPackagerTest.js.snap | 158 ++++++++++----------- test/src/helpers/packTester.ts | 125 ++++++++++------ test/src/mac/macArchiveTest.ts | 1 + 4 files changed, 169 insertions(+), 135 deletions(-) diff --git a/test/snapshots/mac/macArchiveTest.js.snap b/test/snapshots/mac/macArchiveTest.js.snap index 15e504c4e34..5e9ab6da0a2 100644 --- a/test/snapshots/mac/macArchiveTest.js.snap +++ b/test/snapshots/mac/macArchiveTest.js.snap @@ -63,17 +63,17 @@ exports[`extraDistFiles 1`] = ` { "mac": [ { - "file": "Test App ßW-1.1.0-mac.zip.blockmap", - "safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap", + "arch": "x64", + "file": "Test App ßW-1.1.0-mac.zip", + "safeArtifactName": "TestApp-1.1.0-mac.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW-1.1.0-mac.zip", - "safeArtifactName": "TestApp-1.1.0-mac.zip", + "file": "Test App ßW-1.1.0-mac.zip.blockmap", + "safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -152,17 +152,17 @@ exports[`only zip 1`] = ` { "mac": [ { - "file": "Test App ßW-1.1.0-mac.zip.blockmap", - "safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap", + "arch": "x64", + "file": "Test App ßW-1.1.0-mac.zip", + "safeArtifactName": "TestApp-1.1.0-mac.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW-1.1.0-mac.zip", - "safeArtifactName": "TestApp-1.1.0-mac.zip", + "file": "Test App ßW-1.1.0-mac.zip.blockmap", + "safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", diff --git a/test/snapshots/mac/macPackagerTest.js.snap b/test/snapshots/mac/macPackagerTest.js.snap index 5420eaa9ee2..49e5b09016b 100644 --- a/test/snapshots/mac/macPackagerTest.js.snap +++ b/test/snapshots/mac/macPackagerTest.js.snap @@ -4,17 +4,17 @@ exports[`multiple asar resources 1`] = ` { "mac": [ { - "file": "Test App ßW-1.1.0-mac.zip.blockmap", - "safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap", + "arch": "x64", + "file": "Test App ßW-1.1.0-mac.zip", + "safeArtifactName": "TestApp-1.1.0-mac.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW-1.1.0-mac.zip", - "safeArtifactName": "TestApp-1.1.0-mac.zip", + "file": "Test App ßW-1.1.0-mac.zip.blockmap", + "safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -92,8 +92,18 @@ exports[`one-package 1`] = ` { "mac": [ { - "file": "Test App ßW-1.1.0.dmg.blockmap", - "safeArtifactName": "TestApp-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "Test App ßW-1.1.0.dmg", + "safeArtifactName": "TestApp-1.1.0.dmg", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, + { + "arch": "x64", + "file": "Test App ßW-1.1.0-mac.zip", + "safeArtifactName": "TestApp-1.1.0-mac.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -108,9 +118,8 @@ exports[`one-package 1`] = ` }, }, { - "arch": "x64", - "file": "Test App ßW-1.1.0.dmg", - "safeArtifactName": "TestApp-1.1.0.dmg", + "file": "Test App ßW-1.1.0.dmg.blockmap", + "safeArtifactName": "TestApp-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -137,15 +146,6 @@ exports[`one-package 1`] = ` "version": "1.1.0", }, }, - { - "arch": "x64", - "file": "Test App ßW-1.1.0-mac.zip", - "safeArtifactName": "TestApp-1.1.0-mac.zip", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, ], } `; @@ -240,137 +240,137 @@ exports[`two-package 1`] = ` { "mac": [ { - "file": "TestApp-1.1.0-mac-arm64.dmg.blockmap", + "arch": "x64", + "file": "TestApp-1.1.0-mac-x64.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "TestApp-1.1.0-mac-universal.dmg.blockmap", + "arch": "arm64", + "file": "TestApp-1.1.0-mac-arm64.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "TestApp-1.1.0-mac-x64.dmg.blockmap", + "arch": "universal", + "file": "TestApp-1.1.0-mac-universal.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "latest-mac.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "size": "@size", - "url": "TestApp-1.1.0-mac-arm64.dmg", - }, - { - "sha512": "@sha512", - "size": "@size", - "url": "TestApp-1.1.0-mac-arm64.zip", - }, - { - "sha512": "@sha512", - "size": "@size", - "url": "TestApp-1.1.0-mac-universal.dmg", - }, - { - "sha512": "@sha512", - "size": "@size", - "url": "TestApp-1.1.0-mac-universal.zip", - }, - { - "sha512": "@sha512", - "size": "@size", - "url": "TestApp-1.1.0-mac-x64.dmg", - }, - { - "sha512": "@sha512", - "size": "@size", - "url": "TestApp-1.1.0-mac-x64.zip", - }, - ], - "path": "TestApp-1.1.0-mac-x64.zip", - "releaseDate": "@releaseDate", + "arch": "x64", + "file": "TestApp-1.1.0-mac-x64.zip", + "updateInfo": { "sha512": "@sha512", - "version": "1.1.0", + "size": "@size", }, }, { - "file": "TestApp-1.1.0-mac-arm64.zip.blockmap", - "safeArtifactName": "TestApp-1.1.0-mac-arm64.zip.blockmap", + "arch": "arm64", + "file": "TestApp-1.1.0-mac-arm64.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "TestApp-1.1.0-mac-x64.zip.blockmap", - "safeArtifactName": "TestApp-1.1.0-mac-x64.zip.blockmap", + "arch": "universal", + "file": "TestApp-1.1.0-mac-universal.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "TestApp-1.1.0-mac-x64.dmg", + "file": "TestApp-1.1.0-mac-arm64.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "TestApp-1.1.0-mac-universal.zip.blockmap", - "safeArtifactName": "TestApp-1.1.0-mac-universal.zip.blockmap", + "file": "TestApp-1.1.0-mac-arm64.zip.blockmap", + "safeArtifactName": "TestApp-1.1.0-mac-arm64.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "TestApp-1.1.0-mac-x64.zip", + "file": "TestApp-1.1.0-mac-universal.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "arm64", - "file": "TestApp-1.1.0-mac-arm64.dmg", + "file": "TestApp-1.1.0-mac-universal.zip.blockmap", + "safeArtifactName": "TestApp-1.1.0-mac-universal.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "arm64", - "file": "TestApp-1.1.0-mac-arm64.zip", + "file": "TestApp-1.1.0-mac-x64.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "universal", - "file": "TestApp-1.1.0-mac-universal.dmg", + "file": "TestApp-1.1.0-mac-x64.zip.blockmap", + "safeArtifactName": "TestApp-1.1.0-mac-x64.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "universal", - "file": "TestApp-1.1.0-mac-universal.zip", - "updateInfo": { + "file": "latest-mac.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "size": "@size", + "url": "TestApp-1.1.0-mac-arm64.dmg", + }, + { + "sha512": "@sha512", + "size": "@size", + "url": "TestApp-1.1.0-mac-arm64.zip", + }, + { + "sha512": "@sha512", + "size": "@size", + "url": "TestApp-1.1.0-mac-universal.dmg", + }, + { + "sha512": "@sha512", + "size": "@size", + "url": "TestApp-1.1.0-mac-universal.zip", + }, + { + "sha512": "@sha512", + "size": "@size", + "url": "TestApp-1.1.0-mac-x64.dmg", + }, + { + "sha512": "@sha512", + "size": "@size", + "url": "TestApp-1.1.0-mac-x64.zip", + }, + ], + "path": "TestApp-1.1.0-mac-x64.zip", + "releaseDate": "@releaseDate", "sha512": "@sha512", - "size": "@size", + "version": "1.1.0", }, }, ], diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts index 0ca0dd98fec..439112a9584 100644 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -223,6 +223,49 @@ export function getFixtureDir() { return path.join(__dirname, "..", "..", "fixtures") } +/** + * Determines the priority of a file based on its extension for sorting. + * Lower numbers have higher priority in the sort order. + */ +function getFileTypePriority(file: string): number { + if (file.endsWith(".dmg")) return 1 + if (file.endsWith(".zip")) return 2 + if (file.endsWith(".blockmap")) return 3 + if (file.endsWith(".yml")) return 4 + return 5 +} + +/** + * Sorts artifacts in a deterministic order for consistent test snapshots. + * Sort order: + * 1. Primary: File type (DMG > ZIP > blockmap > YML > others) + * 2. Secondary: Architecture (x64 > ia32 > arm64 > universal) + * 3. Tertiary: Filename (alphabetical) + */ +function sortArtifacts(a: ArtifactCreated, b: ArtifactCreated): number { + // Primary sort: by file extension type + const fileA = a.file ?? "" + const fileB = b.file ?? "" + + const typePriorityA = getFileTypePriority(fileA) + const typePriorityB = getFileTypePriority(fileB) + + if (typePriorityA !== typePriorityB) { + return typePriorityA - typePriorityB + } + + // Secondary sort: by architecture + const archSortKey = (a.arch?.valueOf() ?? 0) - (b.arch?.valueOf() ?? 0) + if (archSortKey !== 0) { + return archSortKey + } + + // Tertiary sort: by filename + const baseNameA = path.basename(fileA) + const baseNameB = path.basename(fileB) + return baseNameA.localeCompare(baseNameB, "en") +} + async function packAndCheck(expect: ExpectStatic, packagerOptions: PackagerOptions, checkOptions: AssertPackOptions) { const cancellationToken = new CancellationToken() const packager = new Packager(packagerOptions, cancellationToken) @@ -245,60 +288,50 @@ async function packAndCheck(expect: ExpectStatic, packagerOptions: PackagerOptio return { packager, outDir } } - function sortKey(a: ArtifactCreated) { - return `${a.target == null ? "no-target" : a.target.name}:${a.file == null ? a.fileContent!.toString("hex") : path.basename(a.file)}` - } - const objectToCompare: any = {} for (const platform of packagerOptions.targets!.keys()) { objectToCompare[platform.buildConfigurationKey] = await Promise.all( - (artifacts.get(platform) || []) - .sort((a, b) => { - const archSortKey = (a.arch?.valueOf() ?? 0) - (b.arch?.valueOf() ?? 0) - const fileNameSortKey = sortKey(a).localeCompare(sortKey(b), "en") - return fileNameSortKey + archSortKey - }) - .map(async it => { - const result: any = { ...it } - const file = result.file - if (file != null) { - if (file.endsWith(".yml")) { - result.fileContent = removeUnstableProperties(load(await fs.readFile(file, "utf-8"))) - } - result.file = path.basename(file) - } - const updateInfo = result.updateInfo - if (updateInfo != null) { - result.updateInfo = removeUnstableProperties(updateInfo) - } - if (updateInfo == null) { - delete result.updateInfo + (artifacts.get(platform) || []).sort(sortArtifacts).map(async it => { + const result: any = { ...it } + const file = result.file + if (file != null) { + if (file.endsWith(".yml")) { + result.fileContent = removeUnstableProperties(load(await fs.readFile(file, "utf-8"))) } + result.file = path.basename(file) + } + const updateInfo = result.updateInfo + if (updateInfo != null) { + result.updateInfo = removeUnstableProperties(updateInfo) + } + if (updateInfo == null) { + delete result.updateInfo + } - // reduce snapshot - avoid noise - if (result.safeArtifactName == null) { - delete result.safeArtifactName - } - if (result.arch == null) { - delete result.arch - } else { - result.arch = Arch[result.arch] - } + // reduce snapshot - avoid noise + if (result.safeArtifactName == null) { + delete result.safeArtifactName + } + if (result.arch == null) { + delete result.arch + } else { + result.arch = Arch[result.arch] + } - if (result.fileContent) { - if (Buffer.isBuffer(result.fileContent)) { - delete result.fileContent - } else if (Array.isArray(result.fileContent.files)) { - result.fileContent.files = result.fileContent.files.sort((a: UpdateFileInfo, b: UpdateFileInfo) => a.url.localeCompare(b.url, "en")) - } + if (result.fileContent) { + if (Buffer.isBuffer(result.fileContent)) { + delete result.fileContent + } else if (Array.isArray(result.fileContent.files)) { + result.fileContent.files = result.fileContent.files.sort((a: UpdateFileInfo, b: UpdateFileInfo) => a.url.localeCompare(b.url, "en")) } + } - delete result.isWriteUpdateInfo - delete result.packager - delete result.target - delete result.publishConfig - return result - }) + delete result.isWriteUpdateInfo + delete result.packager + delete result.target + delete result.publishConfig + return result + }) ) } diff --git a/test/src/mac/macArchiveTest.ts b/test/src/mac/macArchiveTest.ts index a2f521cca53..d070cec8723 100644 --- a/test/src/mac/macArchiveTest.ts +++ b/test/src/mac/macArchiveTest.ts @@ -131,6 +131,7 @@ test.ifMac("pkg scripts", ({ expect }) => const info = parseXml(await fs.readFile(path.join(unpackedDir, "Distribution"), "utf8")) for (const element of info.getElements("pkg-ref")) { element.removeAttribute("installKBytes") + element.removeAttribute("updateKBytes") const bundleVersion = element.elementOrNull("bundle-version") if (bundleVersion != null) { bundleVersion.element("bundle").removeAttribute("CFBundleVersion") From aed8846f06eccb1bdf0fb0c85df31911b4c79554 Mon Sep 17 00:00:00 2001 From: daihere1993 Date: Thu, 21 Aug 2025 14:10:07 +0800 Subject: [PATCH 2/5] Extend getFileTypePriority() to support more artifact types and update snapshots for the revised sort algorithm --- test/snapshots/concurrentBuildsTest.js.snap | 358 +++++++++--------- test/snapshots/filesTest.js.snap | 8 +- test/snapshots/linux/debTest.js.snap | 8 +- test/snapshots/linux/fpmTest.js.snap | 8 +- test/snapshots/linux/linuxArchiveTest.js.snap | 6 +- test/snapshots/mac/dmgTest.js.snap | 84 ++-- test/snapshots/mac/macPackagerTest.js.snap | 8 +- test/snapshots/protonTest.js.snap | 10 +- .../updater/blackboxUpdateTest.js.snap | 60 +-- .../updater/differentialUpdateTest.js.snap | 236 ++++++------ test/snapshots/windows/appxTest.js.snap | 8 +- .../windows/assistedInstallerTest.js.snap | 64 ++-- test/snapshots/windows/msiWrappedTest.js.snap | 50 +-- .../windows/oneClickInstallerTest.js.snap | 118 +++--- test/snapshots/windows/portableTest.js.snap | 8 +- .../windows/squirrelWindowsTest.js.snap | 42 +- .../snapshots/windows/winPackagerTest.js.snap | 20 +- test/src/helpers/packTester.ts | 35 +- 18 files changed, 578 insertions(+), 553 deletions(-) diff --git a/test/snapshots/concurrentBuildsTest.js.snap b/test/snapshots/concurrentBuildsTest.js.snap index 89370f5cdf2..a71a7443d49 100644 --- a/test/snapshots/concurrentBuildsTest.js.snap +++ b/test/snapshots/concurrentBuildsTest.js.snap @@ -3,15 +3,13 @@ exports[`linux concurrent 1`] = ` { "linux": [ + { + "arch": "x64", + "file": "Test Concurrent-1.1.0-x86_64.rpm", + }, { "arch": "armv7l", - "file": "Test Concurrent-1.1.0-armv7l.AppImage", - "safeArtifactName": "Test-Concurrent-1.1.0-armv7l.AppImage", - "updateInfo": { - "blockMapSize": "@blockMapSize", - "sha512": "@sha512", - "size": "@size", - }, + "file": "Test Concurrent-1.1.0-armv7l.rpm", }, { "arch": "x64", @@ -25,11 +23,13 @@ exports[`linux concurrent 1`] = ` }, { "arch": "armv7l", - "file": "Test Concurrent-1.1.0-armv7l.rpm", - }, - { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x86_64.rpm", + "file": "Test Concurrent-1.1.0-armv7l.AppImage", + "safeArtifactName": "Test-Concurrent-1.1.0-armv7l.AppImage", + "updateInfo": { + "blockMapSize": "@blockMapSize", + "sha512": "@sha512", + "size": "@size", + }, }, ], } @@ -39,68 +39,68 @@ exports[`mac concurrent 1`] = ` { "mac": [ { - "file": "Test Concurrent-1.1.0-arm64.dmg.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.dmg.blockmap", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.dmg", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.dmg.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.dmg.blockmap", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.dmg", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-arm64.zip.blockmap", - "safeArtifactName": "Test Concurrent-1.1.0-arm64.zip.blockmap", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.zip", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.zip.blockmap", - "safeArtifactName": "Test Concurrent-1.1.0-x64.zip.blockmap", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.zip", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.dmg", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.dmg", + "file": "Test Concurrent-1.1.0-arm64.dmg.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.zip", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.zip", + "file": "Test Concurrent-1.1.0-arm64.zip.blockmap", + "safeArtifactName": "Test Concurrent-1.1.0-arm64.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.dmg", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.dmg", + "file": "Test Concurrent-1.1.0-x64.dmg.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.zip", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.zip", + "file": "Test Concurrent-1.1.0-x64.zip.blockmap", + "safeArtifactName": "Test Concurrent-1.1.0-x64.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -172,9 +172,9 @@ exports[`mac/win/linux concurrent 1`] = ` { "linux": [ { - "arch": "armv7l", - "file": "Test Concurrent-1.1.0-armv7l.AppImage", - "safeArtifactName": "Test-Concurrent-1.1.0-armv7l.AppImage", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x86_64.AppImage", + "safeArtifactName": "Test-Concurrent-1.1.0-x86_64.AppImage", "updateInfo": { "blockMapSize": "@blockMapSize", "sha512": "@sha512", @@ -182,9 +182,9 @@ exports[`mac/win/linux concurrent 1`] = ` }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x86_64.AppImage", - "safeArtifactName": "Test-Concurrent-1.1.0-x86_64.AppImage", + "arch": "armv7l", + "file": "Test Concurrent-1.1.0-armv7l.AppImage", + "safeArtifactName": "Test-Concurrent-1.1.0-armv7l.AppImage", "updateInfo": { "blockMapSize": "@blockMapSize", "sha512": "@sha512", @@ -194,68 +194,68 @@ exports[`mac/win/linux concurrent 1`] = ` ], "mac": [ { - "file": "Test Concurrent-1.1.0-arm64.dmg.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.dmg.blockmap", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.dmg", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.dmg.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.dmg.blockmap", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.dmg", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-arm64.zip.blockmap", - "safeArtifactName": "Test Concurrent-1.1.0-arm64.zip.blockmap", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.zip", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.zip.blockmap", - "safeArtifactName": "Test Concurrent-1.1.0-x64.zip.blockmap", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.zip", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.dmg", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.dmg", + "file": "Test Concurrent-1.1.0-arm64.dmg.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.zip", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.zip", + "file": "Test Concurrent-1.1.0-arm64.zip.blockmap", + "safeArtifactName": "Test Concurrent-1.1.0-arm64.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.dmg", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.dmg", + "file": "Test Concurrent-1.1.0-x64.dmg.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.zip", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.zip", + "file": "Test Concurrent-1.1.0-x64.zip.blockmap", + "safeArtifactName": "Test Concurrent-1.1.0-x64.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -264,50 +264,50 @@ exports[`mac/win/linux concurrent 1`] = ` ], "win": [ { - "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", + "file": "Test Concurrent-1.1.0.exe", + "safeArtifactName": "Test-Concurrent-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0.exe", - "safeArtifactName": "Test-Concurrent-1.1.0.exe", + "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", + "file": "Test Concurrent-1.1.0-x64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", + "file": "Test Concurrent-1.1.0.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -529,30 +529,16 @@ exports[`win concurrent - all targets 1`] = ` { "win": [ { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.7z", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.7z", - }, - { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.appx", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.appx", - }, - { - "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", + "file": "Test Concurrent-1.1.0.exe", + "safeArtifactName": "Test-Concurrent-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, + "file": "Test Concurrent-1.1.0.exe", + "safeArtifactName": "Test-Concurrent-1.1.0.exe", }, { "arch": "x64", @@ -564,119 +550,133 @@ exports[`win concurrent - all targets 1`] = ` }, }, { - "file": "Test Concurrent-1.1.0.exe", - "safeArtifactName": "Test-Concurrent-1.1.0.exe", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", }, { - "file": "Test Concurrent-1.1.0.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.exe", + "safeArtifactName": "concurrent-Setup-1.1.0.exe", + }, + { + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", }, { - "file": "Test Concurrent-1.1.0.exe", - "safeArtifactName": "Test-Concurrent-1.1.0.exe", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.exe", + "safeArtifactName": "concurrent-Setup-1.1.0-arm64.exe", }, { "arch": "x64", - "file": "concurrent-1.1.0-full.nupkg", + "file": "Test Concurrent-1.1.0-x64.appx", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.appx", }, { - "arch": "x64", - "file": "RELEASES", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.appx", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.appx", }, { "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.exe", - "safeArtifactName": "concurrent-Setup-1.1.0.exe", + "file": "Test Concurrent-1.1.0-x64.zip", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.zip", }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.tar.bz2", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.tar.bz2", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.zip", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.zip", }, { "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.tar.gz", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.tar.gz", + "file": "Test Concurrent-1.1.0-x64.7z", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.7z", }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.tar.xz", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.tar.xz", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.7z", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.7z", }, { "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.zip", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.zip", + "file": "Test Concurrent-1.1.0-x64.tar.gz", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.tar.gz", }, { "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.7z", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.7z", + "file": "Test Concurrent-1.1.0-arm64.tar.gz", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.tar.gz", }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.appx", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.appx", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.tar.xz", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.tar.xz", }, { "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, + "file": "Test Concurrent-1.1.0-arm64.tar.xz", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.tar.xz", }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.tar.bz2", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.tar.bz2", }, { "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.tar.bz2", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.tar.bz2", + }, + { + "arch": "x64", "file": "concurrent-1.1.0-full.nupkg", }, { "arch": "arm64", - "file": "RELEASES", + "file": "concurrent-1.1.0-full.nupkg", }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.exe", - "safeArtifactName": "concurrent-Setup-1.1.0-arm64.exe", + "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.tar.bz2", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.tar.bz2", + "file": "Test Concurrent-1.1.0-x64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.tar.gz", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.tar.gz", + "file": "Test Concurrent-1.1.0.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.tar.xz", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.tar.xz", + "arch": "x64", + "file": "RELEASES", }, { "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.zip", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.zip", + "file": "RELEASES", }, ], } @@ -758,50 +758,50 @@ exports[`win concurrent 1`] = ` { "win": [ { - "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", + "file": "Test Concurrent-1.1.0.exe", + "safeArtifactName": "Test-Concurrent-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0.exe", - "safeArtifactName": "Test-Concurrent-1.1.0.exe", + "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", + "file": "Test Concurrent-1.1.0-x64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", + "file": "Test Concurrent-1.1.0.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -815,9 +815,9 @@ exports[`win/linux concurrent 1`] = ` { "linux": [ { - "arch": "armv7l", - "file": "Test Concurrent-1.1.0-armv7l.AppImage", - "safeArtifactName": "Test-Concurrent-1.1.0-armv7l.AppImage", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x86_64.AppImage", + "safeArtifactName": "Test-Concurrent-1.1.0-x86_64.AppImage", "updateInfo": { "blockMapSize": "@blockMapSize", "sha512": "@sha512", @@ -825,9 +825,9 @@ exports[`win/linux concurrent 1`] = ` }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x86_64.AppImage", - "safeArtifactName": "Test-Concurrent-1.1.0-x86_64.AppImage", + "arch": "armv7l", + "file": "Test Concurrent-1.1.0-armv7l.AppImage", + "safeArtifactName": "Test-Concurrent-1.1.0-armv7l.AppImage", "updateInfo": { "blockMapSize": "@blockMapSize", "sha512": "@sha512", @@ -837,42 +837,42 @@ exports[`win/linux concurrent 1`] = ` ], "win": [ { - "arch": "arm64", - "file": "Test Concurrent-1.1.0-arm64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", + "file": "Test Concurrent-1.1.0.exe", + "safeArtifactName": "Test-Concurrent-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", + "arch": "x64", + "file": "Test Concurrent-1.1.0-x64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test Concurrent-1.1.0-x64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", + "arch": "arm64", + "file": "Test Concurrent-1.1.0-arm64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", + "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0.exe", - "safeArtifactName": "Test-Concurrent-1.1.0.exe", + "file": "Test Concurrent-1.1.0-x64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", diff --git a/test/snapshots/filesTest.js.snap b/test/snapshots/filesTest.js.snap index c4f5f17b458..58e344d259c 100644 --- a/test/snapshots/filesTest.js.snap +++ b/test/snapshots/filesTest.js.snap @@ -17,10 +17,6 @@ exports[`extraResources on Linux 1`] = ` exports[`extraResources on Windows 1`] = ` { "win": [ - { - "arch": "x64", - "file": "RELEASES", - }, { "arch": "x64", "file": "Test App ßW Setup 1.1.0.exe", @@ -30,6 +26,10 @@ exports[`extraResources on Windows 1`] = ` "arch": "x64", "file": "TestApp-1.1.0-full.nupkg", }, + { + "arch": "x64", + "file": "RELEASES", + }, ], } `; diff --git a/test/snapshots/linux/debTest.js.snap b/test/snapshots/linux/debTest.js.snap index 4e690f464b3..228f1cd988e 100644 --- a/test/snapshots/linux/debTest.js.snap +++ b/test/snapshots/linux/debTest.js.snap @@ -3,14 +3,14 @@ exports[`arm 1`] = ` { "linux": [ - { - "arch": "armv7l", - "file": "TestApp_1.1.0_armv7l.deb", - }, { "arch": "arm64", "file": "TestApp_1.1.0_arm64.deb", }, + { + "arch": "armv7l", + "file": "TestApp_1.1.0_armv7l.deb", + }, ], } `; diff --git a/test/snapshots/linux/fpmTest.js.snap b/test/snapshots/linux/fpmTest.js.snap index de88cac2297..4d97144d581 100644 --- a/test/snapshots/linux/fpmTest.js.snap +++ b/test/snapshots/linux/fpmTest.js.snap @@ -18,6 +18,10 @@ exports[`rpm and tar.gz 1`] = ` exports[`targets 1`] = ` { "linux": [ + { + "arch": "x64", + "file": "TestApp-1.1.0.zip", + }, { "arch": "x64", "file": "TestApp-1.1.0.7z", @@ -34,10 +38,6 @@ exports[`targets 1`] = ` "arch": "x64", "file": "TestApp-1.1.0.sh", }, - { - "arch": "x64", - "file": "TestApp-1.1.0.zip", - }, ], } `; diff --git a/test/snapshots/linux/linuxArchiveTest.js.snap b/test/snapshots/linux/linuxArchiveTest.js.snap index 50e8e025b56..360fc77ac98 100644 --- a/test/snapshots/linux/linuxArchiveTest.js.snap +++ b/test/snapshots/linux/linuxArchiveTest.js.snap @@ -5,15 +5,15 @@ exports[`tar 1`] = ` "linux": [ { "arch": "x64", - "file": "TestApp-1.1.0.tar.bz2", + "file": "TestApp-1.1.0.tar.xz", }, { "arch": "x64", - "file": "TestApp-1.1.0.tar.lz", + "file": "TestApp-1.1.0.tar.bz2", }, { "arch": "x64", - "file": "TestApp-1.1.0.tar.xz", + "file": "TestApp-1.1.0.tar.lz", }, ], } diff --git a/test/snapshots/mac/dmgTest.js.snap b/test/snapshots/mac/dmgTest.js.snap index c678e8ae0f6..e7a9b3771e6 100644 --- a/test/snapshots/mac/dmgTest.js.snap +++ b/test/snapshots/mac/dmgTest.js.snap @@ -228,15 +228,15 @@ exports[`dmg > bundleShortVersion 1`] = ` { "mac": [ { - "file": "Bundle-ShortVersion-2017.1-alpha5.dmg.blockmap", + "arch": "x64", + "file": "Bundle-ShortVersion-2017.1-alpha5.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Bundle-ShortVersion-2017.1-alpha5.dmg", + "file": "Bundle-ShortVersion-2017.1-alpha5.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -297,16 +297,16 @@ exports[`dmg > custom background - new way 1`] = ` { "mac": [ { - "file": "CustomBackground-1.1.0-mac.zip.blockmap", - "safeArtifactName": "CustomBackground-1.1.0-mac.zip.blockmap", + "arch": "x64", + "file": "CustomBackground-1.1.0-mac.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "CustomBackground-1.1.0-mac.zip", + "file": "CustomBackground-1.1.0-mac.zip.blockmap", + "safeArtifactName": "CustomBackground-1.1.0-mac.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -367,16 +367,16 @@ exports[`dmg > disable dmg icon (light), bundleVersion 1`] = ` { "mac": [ { - "file": "Disable-Icon-1.1.0-mac.zip.blockmap", - "safeArtifactName": "Disable-Icon-1.1.0-mac.zip.blockmap", + "arch": "x64", + "file": "Disable-Icon-1.1.0-mac.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Disable-Icon-1.1.0-mac.zip", + "file": "Disable-Icon-1.1.0-mac.zip.blockmap", + "safeArtifactName": "Disable-Icon-1.1.0-mac.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -437,15 +437,15 @@ exports[`dmg > dmg 1`] = ` { "mac": [ { - "file": "Default-Dmg-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "Default-Dmg-1.1.0.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Default-Dmg-1.1.0.dmg", + "file": "Default-Dmg-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -564,15 +564,15 @@ exports[`dmg > license buttons config 2`] = ` { "mac": [ { - "file": "Foo-5-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "Foo-5-1.1.0.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Foo-5-1.1.0.dmg", + "file": "Foo-5-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -633,15 +633,15 @@ exports[`dmg > license en 1`] = ` { "mac": [ { - "file": "Foo-3-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "Foo-3-1.1.0.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Foo-3-1.1.0.dmg", + "file": "Foo-3-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -702,15 +702,15 @@ exports[`dmg > license ja 1`] = ` { "mac": [ { - "file": "Foo-2-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "Foo-2-1.1.0.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Foo-2-1.1.0.dmg", + "file": "Foo-2-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -771,15 +771,15 @@ exports[`dmg > license rtf 1`] = ` { "mac": [ { - "file": "Foo-4-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "Foo-4-1.1.0.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Foo-4-1.1.0.dmg", + "file": "Foo-4-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -840,15 +840,15 @@ exports[`dmg > multi language license 1`] = ` { "mac": [ { - "file": "Foo-1-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "Foo-1-1.1.0.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Foo-1-1.1.0.dmg", + "file": "Foo-1-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -909,15 +909,15 @@ exports[`dmg > no background 1`] = ` { "mac": [ { - "file": "No-Background-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "No-Background-1.1.0.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "No-Background-1.1.0.dmg", + "file": "No-Background-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -996,15 +996,15 @@ exports[`dmg > no build directory 2`] = ` { "mac": [ { - "file": "NoBuildDirectory-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "NoBuildDirectory-1.1.0.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "NoBuildDirectory-1.1.0.dmg", + "file": "NoBuildDirectory-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -1065,16 +1065,16 @@ exports[`dmg > retina background as 2 png 1`] = ` { "mac": [ { - "file": "RetinaBackground-1.1.0-mac.zip.blockmap", - "safeArtifactName": "RetinaBackground-1.1.0-mac.zip.blockmap", + "arch": "x64", + "file": "RetinaBackground-1.1.0-mac.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "RetinaBackground-1.1.0-mac.zip", + "file": "RetinaBackground-1.1.0-mac.zip.blockmap", + "safeArtifactName": "RetinaBackground-1.1.0-mac.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -1135,15 +1135,15 @@ exports[`dmg > unset dmg icon 1`] = ` { "mac": [ { - "file": "No_Volume_Icon-1.1.0.dmg.blockmap", + "arch": "x64", + "file": "No_Volume_Icon-1.1.0.dmg", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "No_Volume_Icon-1.1.0.dmg", + "file": "No_Volume_Icon-1.1.0.dmg.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", diff --git a/test/snapshots/mac/macPackagerTest.js.snap b/test/snapshots/mac/macPackagerTest.js.snap index 49e5b09016b..f0797ebca7a 100644 --- a/test/snapshots/mac/macPackagerTest.js.snap +++ b/test/snapshots/mac/macPackagerTest.js.snap @@ -595,16 +595,16 @@ exports[`yarn two package.json w/ native module 1`] = ` { "mac": [ { - "file": "test-app-two-native-modules-1.1.1-universal-mac.zip.blockmap", - "safeArtifactName": "test-app-two-native-modules-1.1.1-universal-mac.zip.blockmap", + "arch": "universal", + "file": "test-app-two-native-modules-1.1.1-universal-mac.zip", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "universal", - "file": "test-app-two-native-modules-1.1.1-universal-mac.zip", + "file": "test-app-two-native-modules-1.1.1-universal-mac.zip.blockmap", + "safeArtifactName": "test-app-two-native-modules-1.1.1-universal-mac.zip.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", diff --git a/test/snapshots/protonTest.js.snap b/test/snapshots/protonTest.js.snap index fde9150fe73..a2fd70aefca 100644 --- a/test/snapshots/protonTest.js.snap +++ b/test/snapshots/protonTest.js.snap @@ -58,17 +58,17 @@ exports[`win 1`] = ` { "win": [ { - "file": "Test App ßW Setup 1.1.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", diff --git a/test/snapshots/updater/blackboxUpdateTest.js.snap b/test/snapshots/updater/blackboxUpdateTest.js.snap index 45d2a3ddff9..9d1eddc9724 100644 --- a/test/snapshots/updater/blackboxUpdateTest.js.snap +++ b/test/snapshots/updater/blackboxUpdateTest.js.snap @@ -563,6 +563,14 @@ exports[`Electron autoupdate (fresh install & update) > linux > debian - (dpkg) exports[`Electron autoupdate (fresh install & update) > win 1`] = ` { "win": [ + { + "file": "TestApp Setup.exe.blockmap", + "safeArtifactName": "TestApp-Setup.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "latest.yml", "fileContent": { @@ -579,14 +587,6 @@ exports[`Electron autoupdate (fresh install & update) > win 1`] = ` "version": "1.0.0", }, }, - { - "file": "TestApp Setup.exe.blockmap", - "safeArtifactName": "TestApp-Setup.exe.blockmap", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, { "arch": "x64", "file": "TestApp Setup.exe", @@ -603,6 +603,14 @@ exports[`Electron autoupdate (fresh install & update) > win 1`] = ` exports[`Electron autoupdate (fresh install & update) > win 2`] = ` { "win": [ + { + "file": "TestApp Setup.exe.blockmap", + "safeArtifactName": "TestApp-Setup.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "latest.yml", "fileContent": { @@ -619,14 +627,6 @@ exports[`Electron autoupdate (fresh install & update) > win 2`] = ` "version": "1.0.1", }, }, - { - "file": "TestApp Setup.exe.blockmap", - "safeArtifactName": "TestApp-Setup.exe.blockmap", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, { "arch": "x64", "file": "TestApp Setup.exe", @@ -742,6 +742,13 @@ exports[`Electron autoupdate from 1.0.0 to 1.0.1 (live test) > linux > linux 1`] exports[`Electron autoupdate from 1.0.0 to 1.0.1 (live test) > win 1`] = ` { "win": [ + { + "file": "TestApp.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "latest.yml", "fileContent": { @@ -766,13 +773,6 @@ exports[`Electron autoupdate from 1.0.0 to 1.0.1 (live test) > win 1`] = ` "size": "@size", }, }, - { - "file": "TestApp.exe.blockmap", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, ], } `; @@ -780,6 +780,13 @@ exports[`Electron autoupdate from 1.0.0 to 1.0.1 (live test) > win 1`] = ` exports[`Electron autoupdate from 1.0.0 to 1.0.1 (live test) > win 2`] = ` { "win": [ + { + "file": "TestApp.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "latest.yml", "fileContent": { @@ -804,13 +811,6 @@ exports[`Electron autoupdate from 1.0.0 to 1.0.1 (live test) > win 2`] = ` "size": "@size", }, }, - { - "file": "TestApp.exe.blockmap", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, ], } `; diff --git a/test/snapshots/updater/differentialUpdateTest.js.snap b/test/snapshots/updater/differentialUpdateTest.js.snap index b4dfee51e0b..f17e2ce2887 100644 --- a/test/snapshots/updater/differentialUpdateTest.js.snap +++ b/test/snapshots/updater/differentialUpdateTest.js.snap @@ -184,19 +184,12 @@ exports[`Mac Intel 1`] = ` { "mac": [ { - "file": "latest-mac.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.0-mac.zip", - }, - ], - "path": "Test App ßW-1.0.0-mac.zip", - "releaseDate": "@releaseDate", + "arch": "x64", + "file": "Test App ßW-1.0.0-mac.zip", + "safeArtifactName": "TestApp-1.0.0-mac.zip", + "updateInfo": { "sha512": "@sha512", - "version": "1.0.0", + "size": "@size", }, }, { @@ -208,12 +201,19 @@ exports[`Mac Intel 1`] = ` }, }, { - "arch": "x64", - "file": "Test App ßW-1.0.0-mac.zip", - "safeArtifactName": "TestApp-1.0.0-mac.zip", - "updateInfo": { + "file": "latest-mac.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "size": "@size", + "url": "Test App ßW-1.0.0-mac.zip", + }, + ], + "path": "Test App ßW-1.0.0-mac.zip", + "releaseDate": "@releaseDate", "sha512": "@sha512", - "size": "@size", + "version": "1.0.0", }, }, ], @@ -271,19 +271,12 @@ exports[`Mac Intel 3`] = ` { "mac": [ { - "file": "latest-mac.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.1-mac.zip", - }, - ], - "path": "Test App ßW-1.0.1-mac.zip", - "releaseDate": "@releaseDate", + "arch": "x64", + "file": "Test App ßW-1.0.1-mac.zip", + "safeArtifactName": "TestApp-1.0.1-mac.zip", + "updateInfo": { "sha512": "@sha512", - "version": "1.0.1", + "size": "@size", }, }, { @@ -295,12 +288,19 @@ exports[`Mac Intel 3`] = ` }, }, { - "arch": "x64", - "file": "Test App ßW-1.0.1-mac.zip", - "safeArtifactName": "TestApp-1.0.1-mac.zip", - "updateInfo": { + "file": "latest-mac.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "size": "@size", + "url": "Test App ßW-1.0.1-mac.zip", + }, + ], + "path": "Test App ßW-1.0.1-mac.zip", + "releaseDate": "@releaseDate", "sha512": "@sha512", - "size": "@size", + "version": "1.0.1", }, }, ], @@ -379,19 +379,12 @@ exports[`Mac arm64 1`] = ` { "mac": [ { - "file": "latest-mac.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.0-arm64-mac.zip", - }, - ], - "path": "Test App ßW-1.0.0-arm64-mac.zip", - "releaseDate": "@releaseDate", + "arch": "arm64", + "file": "Test App ßW-1.0.0-arm64-mac.zip", + "safeArtifactName": "TestApp-1.0.0-arm64-mac.zip", + "updateInfo": { "sha512": "@sha512", - "version": "1.0.0", + "size": "@size", }, }, { @@ -403,12 +396,19 @@ exports[`Mac arm64 1`] = ` }, }, { - "arch": "arm64", - "file": "Test App ßW-1.0.0-arm64-mac.zip", - "safeArtifactName": "TestApp-1.0.0-arm64-mac.zip", - "updateInfo": { + "file": "latest-mac.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "size": "@size", + "url": "Test App ßW-1.0.0-arm64-mac.zip", + }, + ], + "path": "Test App ßW-1.0.0-arm64-mac.zip", + "releaseDate": "@releaseDate", "sha512": "@sha512", - "size": "@size", + "version": "1.0.0", }, }, ], @@ -466,19 +466,12 @@ exports[`Mac arm64 3`] = ` { "mac": [ { - "file": "latest-mac.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.1-arm64-mac.zip", - }, - ], - "path": "Test App ßW-1.0.1-arm64-mac.zip", - "releaseDate": "@releaseDate", + "arch": "arm64", + "file": "Test App ßW-1.0.1-arm64-mac.zip", + "safeArtifactName": "TestApp-1.0.1-arm64-mac.zip", + "updateInfo": { "sha512": "@sha512", - "version": "1.0.1", + "size": "@size", }, }, { @@ -490,12 +483,19 @@ exports[`Mac arm64 3`] = ` }, }, { - "arch": "arm64", - "file": "Test App ßW-1.0.1-arm64-mac.zip", - "safeArtifactName": "TestApp-1.0.1-arm64-mac.zip", - "updateInfo": { + "file": "latest-mac.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "size": "@size", + "url": "Test App ßW-1.0.1-arm64-mac.zip", + }, + ], + "path": "Test App ßW-1.0.1-arm64-mac.zip", + "releaseDate": "@releaseDate", "sha512": "@sha512", - "size": "@size", + "version": "1.0.1", }, }, ], @@ -574,19 +574,12 @@ exports[`Mac universal 1`] = ` { "mac": [ { - "file": "latest-mac.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.0-universal-mac.zip", - }, - ], - "path": "Test App ßW-1.0.0-universal-mac.zip", - "releaseDate": "@releaseDate", + "arch": "universal", + "file": "Test App ßW-1.0.0-universal-mac.zip", + "safeArtifactName": "TestApp-1.0.0-universal-mac.zip", + "updateInfo": { "sha512": "@sha512", - "version": "1.0.0", + "size": "@size", }, }, { @@ -598,12 +591,19 @@ exports[`Mac universal 1`] = ` }, }, { - "arch": "universal", - "file": "Test App ßW-1.0.0-universal-mac.zip", - "safeArtifactName": "TestApp-1.0.0-universal-mac.zip", - "updateInfo": { + "file": "latest-mac.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "size": "@size", + "url": "Test App ßW-1.0.0-universal-mac.zip", + }, + ], + "path": "Test App ßW-1.0.0-universal-mac.zip", + "releaseDate": "@releaseDate", "sha512": "@sha512", - "size": "@size", + "version": "1.0.0", }, }, ], @@ -661,19 +661,12 @@ exports[`Mac universal 3`] = ` { "mac": [ { - "file": "latest-mac.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW-1.0.1-universal-mac.zip", - }, - ], - "path": "Test App ßW-1.0.1-universal-mac.zip", - "releaseDate": "@releaseDate", + "arch": "universal", + "file": "Test App ßW-1.0.1-universal-mac.zip", + "safeArtifactName": "TestApp-1.0.1-universal-mac.zip", + "updateInfo": { "sha512": "@sha512", - "version": "1.0.1", + "size": "@size", }, }, { @@ -685,12 +678,19 @@ exports[`Mac universal 3`] = ` }, }, { - "arch": "universal", - "file": "Test App ßW-1.0.1-universal-mac.zip", - "safeArtifactName": "TestApp-1.0.1-universal-mac.zip", - "updateInfo": { + "file": "latest-mac.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "size": "@size", + "url": "Test App ßW-1.0.1-universal-mac.zip", + }, + ], + "path": "Test App ßW-1.0.1-universal-mac.zip", + "releaseDate": "@releaseDate", "sha512": "@sha512", - "size": "@size", + "version": "1.0.1", }, }, ], @@ -768,6 +768,14 @@ exports[`Mac universal 6`] = ` exports[`nsis 1`] = ` { "win": [ + { + "file": "Test App ßW Setup 1.0.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.0.0.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "latest.yml", "fileContent": { @@ -784,14 +792,6 @@ exports[`nsis 1`] = ` "version": "1.0.0", }, }, - { - "file": "Test App ßW Setup 1.0.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.0.0.exe.blockmap", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, { "arch": "x64", "file": "Test App ßW Setup 1.0.0.exe", @@ -808,6 +808,14 @@ exports[`nsis 1`] = ` exports[`nsis 2`] = ` { "win": [ + { + "file": "Test App ßW Setup 1.0.1.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.0.1.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "latest.yml", "fileContent": { @@ -824,14 +832,6 @@ exports[`nsis 2`] = ` "version": "1.0.1", }, }, - { - "file": "Test App ßW Setup 1.0.1.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.0.1.exe.blockmap", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, { "arch": "x64", "file": "Test App ßW Setup 1.0.1.exe", diff --git a/test/snapshots/windows/appxTest.js.snap b/test/snapshots/windows/appxTest.js.snap index 71831f2c9a0..652a88e0a7b 100644 --- a/test/snapshots/windows/appxTest.js.snap +++ b/test/snapshots/windows/appxTest.js.snap @@ -181,13 +181,13 @@ exports[`languages and not signed (windows store only) 1`] = ` { "win": [ { - "arch": "ia32", - "file": "Test App ßW 1.1.0 ia32.appx", + "arch": "x64", + "file": "Test App ßW 1.1.0.appx", "safeArtifactName": "TestApp-1.1.0.appx", }, { - "arch": "x64", - "file": "Test App ßW 1.1.0.appx", + "arch": "ia32", + "file": "Test App ßW 1.1.0 ia32.appx", "safeArtifactName": "TestApp-1.1.0.appx", }, ], diff --git a/test/snapshots/windows/assistedInstallerTest.js.snap b/test/snapshots/windows/assistedInstallerTest.js.snap index c06a0d6f41a..6e78be440b2 100644 --- a/test/snapshots/windows/assistedInstallerTest.js.snap +++ b/test/snapshots/windows/assistedInstallerTest.js.snap @@ -15,6 +15,23 @@ exports[`allowElevation false, app requestedExecutionLevel admin 1`] = ` exports[`allowToChangeInstallationDirectory 1`] = ` { "win": [ + { + "arch": "x64", + "file": "Test Custom Installation Dir Setup 1.1.0.exe", + "safeArtifactName": "Test-Custom-Installation-Dir-Setup-1.1.0.exe", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, + { + "file": "Test Custom Installation Dir Setup 1.1.0.exe.blockmap", + "safeArtifactName": "Test-Custom-Installation-Dir-Setup-1.1.0.exe.blockmap", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "latest.yml", "fileContent": { @@ -34,23 +51,6 @@ without features", "version": "1.1.0", }, }, - { - "file": "Test Custom Installation Dir Setup 1.1.0.exe.blockmap", - "safeArtifactName": "Test-Custom-Installation-Dir-Setup-1.1.0.exe.blockmap", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, - { - "arch": "x64", - "file": "Test Custom Installation Dir Setup 1.1.0.exe", - "safeArtifactName": "Test-Custom-Installation-Dir-Setup-1.1.0.exe", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, ], } `; @@ -68,17 +68,17 @@ exports[`assisted 1`] = ` { "win": [ { - "file": "Test App ßW Setup 1.1.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -109,17 +109,17 @@ exports[`assisted, only perMachine 1`] = ` { "win": [ { - "file": "Test App ßW Setup 1.1.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -133,8 +133,9 @@ exports[`assisted, only perMachine and elevated 1`] = ` { "win": [ { - "file": "Test App ßW Setup 1.1.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", "updateInfo": { "isAdminRightsRequired": true, "sha512": "@sha512", @@ -142,9 +143,8 @@ exports[`assisted, only perMachine and elevated 1`] = ` }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", "updateInfo": { "isAdminRightsRequired": true, "sha512": "@sha512", diff --git a/test/snapshots/windows/msiWrappedTest.js.snap b/test/snapshots/windows/msiWrappedTest.js.snap index eb6f4693816..84196010d42 100644 --- a/test/snapshots/windows/msiWrappedTest.js.snap +++ b/test/snapshots/windows/msiWrappedTest.js.snap @@ -3,11 +3,6 @@ exports[`msiWrapped allows capitalized nsis target 1`] = ` { "win": [ - { - "arch": "x64", - "file": "Test MSI 1.1.0.msi", - "safeArtifactName": "Test-MSI-1.1.0.msi", - }, { "arch": "x64", "file": "Test MSI Setup 1.1.0.exe", @@ -17,6 +12,11 @@ exports[`msiWrapped allows capitalized nsis target 1`] = ` "size": "@size", }, }, + { + "arch": "x64", + "file": "Test MSI 1.1.0.msi", + "safeArtifactName": "Test-MSI-1.1.0.msi", + }, { "file": "Test MSI Setup 1.1.0.exe.blockmap", "safeArtifactName": "Test-MSI-Setup-1.1.0.exe.blockmap", @@ -32,11 +32,6 @@ exports[`msiWrapped allows capitalized nsis target 1`] = ` exports[`msiWrapped impersonate no if not provided 1`] = ` { "win": [ - { - "arch": "x64", - "file": "MSIWrappingEXE 1.1.0.msi", - "safeArtifactName": "MSIWrappingEXE-1.1.0.msi", - }, { "arch": "x64", "file": "MSIWrappingEXE Setup 1.1.0.exe", @@ -46,6 +41,11 @@ exports[`msiWrapped impersonate no if not provided 1`] = ` "size": "@size", }, }, + { + "arch": "x64", + "file": "MSIWrappingEXE 1.1.0.msi", + "safeArtifactName": "MSIWrappingEXE-1.1.0.msi", + }, { "file": "MSIWrappingEXE Setup 1.1.0.exe.blockmap", "safeArtifactName": "MSIWrappingEXE-Setup-1.1.0.exe.blockmap", @@ -61,11 +61,6 @@ exports[`msiWrapped impersonate no if not provided 1`] = ` exports[`msiWrapped impersonate yes if true 1`] = ` { "win": [ - { - "arch": "x64", - "file": "MSIWrappingEXE 1.1.0.msi", - "safeArtifactName": "MSIWrappingEXE-1.1.0.msi", - }, { "arch": "x64", "file": "MSIWrappingEXE Setup 1.1.0.exe", @@ -75,6 +70,11 @@ exports[`msiWrapped impersonate yes if true 1`] = ` "size": "@size", }, }, + { + "arch": "x64", + "file": "MSIWrappingEXE 1.1.0.msi", + "safeArtifactName": "MSIWrappingEXE-1.1.0.msi", + }, { "file": "MSIWrappingEXE Setup 1.1.0.exe.blockmap", "safeArtifactName": "MSIWrappingEXE-Setup-1.1.0.exe.blockmap", @@ -90,11 +90,6 @@ exports[`msiWrapped impersonate yes if true 1`] = ` exports[`msiWrapped includes packaged exe 1`] = ` { "win": [ - { - "arch": "x64", - "file": "MSIWrappingEXE 1.1.0.msi", - "safeArtifactName": "MSIWrappingEXE-1.1.0.msi", - }, { "arch": "x64", "file": "MSIWrappingEXE Setup 1.1.0.exe", @@ -104,6 +99,11 @@ exports[`msiWrapped includes packaged exe 1`] = ` "size": "@size", }, }, + { + "arch": "x64", + "file": "MSIWrappingEXE 1.1.0.msi", + "safeArtifactName": "MSIWrappingEXE-1.1.0.msi", + }, { "file": "MSIWrappingEXE Setup 1.1.0.exe.blockmap", "safeArtifactName": "MSIWrappingEXE-Setup-1.1.0.exe.blockmap", @@ -119,11 +119,6 @@ exports[`msiWrapped includes packaged exe 1`] = ` exports[`msiWrapped wrappedInstallerArgs provided 1`] = ` { "win": [ - { - "arch": "x64", - "file": "MSIWrappingEXE 1.1.0.msi", - "safeArtifactName": "MSIWrappingEXE-1.1.0.msi", - }, { "arch": "x64", "file": "MSIWrappingEXE Setup 1.1.0.exe", @@ -133,6 +128,11 @@ exports[`msiWrapped wrappedInstallerArgs provided 1`] = ` "size": "@size", }, }, + { + "arch": "x64", + "file": "MSIWrappingEXE 1.1.0.msi", + "safeArtifactName": "MSIWrappingEXE-1.1.0.msi", + }, { "file": "MSIWrappingEXE Setup 1.1.0.exe.blockmap", "safeArtifactName": "MSIWrappingEXE-Setup-1.1.0.exe.blockmap", diff --git a/test/snapshots/windows/oneClickInstallerTest.js.snap b/test/snapshots/windows/oneClickInstallerTest.js.snap index aeb799f019d..80130c66656 100644 --- a/test/snapshots/windows/oneClickInstallerTest.js.snap +++ b/test/snapshots/windows/oneClickInstallerTest.js.snap @@ -16,17 +16,17 @@ exports[`createDesktopShortcut always 1`] = ` { "win": [ { - "file": "Test App ßW Setup 1.1.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -106,17 +106,17 @@ exports[`custom include 1`] = ` { "win": [ { - "file": "Test App ßW Setup 1.1.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -130,17 +130,17 @@ exports[`custom script 1`] = ` { "win": [ { - "file": "Test App ßW Setup 1.1.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -178,17 +178,17 @@ exports[`html license 1`] = ` { "win": [ { - "file": "Test App ßW Setup 1.1.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -250,17 +250,17 @@ exports[`multi language license 1`] = ` { "win": [ { - "file": "Test App ßW Setup 1.1.0.exe.blockmap", - "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe.blockmap", + "safeArtifactName": "TestApp-Setup-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", @@ -274,19 +274,12 @@ exports[`one-click 1`] = ` { "win": [ { - "file": "latest.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "size": "@size", - "url": "Test App ßW Setup 1.1.0.exe", - }, - ], - "path": "Test App ßW Setup 1.1.0.exe", - "releaseDate": "@releaseDate", + "arch": "x64", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "updateInfo": { "sha512": "@sha512", - "version": "1.1.0", + "size": "@size", }, }, { @@ -298,12 +291,19 @@ exports[`one-click 1`] = ` }, }, { - "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", - "updateInfo": { + "file": "latest.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "size": "@size", + "url": "Test App ßW Setup 1.1.0.exe", + }, + ], + "path": "Test App ßW Setup 1.1.0.exe", + "releaseDate": "@releaseDate", "sha512": "@sha512", - "size": "@size", + "version": "1.1.0", }, }, ], @@ -321,23 +321,6 @@ exports[`one-click 2`] = ` exports[`perMachine, no run after finish 1`] = ` { "win": [ - { - "file": "latest.yml", - "fileContent": { - "files": [ - { - "isAdminRightsRequired": true, - "sha512": "@sha512", - "size": "@size", - "url": "TestApp Setup 1.1.0.exe", - }, - ], - "path": "TestApp Setup 1.1.0.exe", - "releaseDate": "@releaseDate", - "sha512": "@sha512", - "version": "1.1.0", - }, - }, { "arch": "ia32", "file": "TestApp Setup 1.1.0.exe", @@ -357,6 +340,23 @@ exports[`perMachine, no run after finish 1`] = ` "size": "@size", }, }, + { + "file": "latest.yml", + "fileContent": { + "files": [ + { + "isAdminRightsRequired": true, + "sha512": "@sha512", + "size": "@size", + "url": "TestApp Setup 1.1.0.exe", + }, + ], + "path": "TestApp Setup 1.1.0.exe", + "releaseDate": "@releaseDate", + "sha512": "@sha512", + "version": "1.1.0", + }, + }, ], } `; diff --git a/test/snapshots/windows/portableTest.js.snap b/test/snapshots/windows/portableTest.js.snap index 192a3d27e8e..2c500906627 100644 --- a/test/snapshots/windows/portableTest.js.snap +++ b/test/snapshots/windows/portableTest.js.snap @@ -29,13 +29,13 @@ exports[`portable 1`] = ` "win": [ { "arch": "x64", - "file": "Test App ßW Setup 1.1.0.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test App ßW 1.1.0.exe", + "safeArtifactName": "TestApp-1.1.0.exe", }, { "arch": "x64", - "file": "Test App ßW 1.1.0.exe", - "safeArtifactName": "TestApp-1.1.0.exe", + "file": "Test App ßW Setup 1.1.0.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", }, ], } diff --git a/test/snapshots/windows/squirrelWindowsTest.js.snap b/test/snapshots/windows/squirrelWindowsTest.js.snap index 0ea9f8b729d..523e46827a9 100644 --- a/test/snapshots/windows/squirrelWindowsTest.js.snap +++ b/test/snapshots/windows/squirrelWindowsTest.js.snap @@ -3,10 +3,6 @@ exports[`squirrel.windows > Squirrel.Windows 1`] = ` { "win": [ - { - "arch": "x64", - "file": "RELEASES", - }, { "arch": "x64", "file": "Test App ßW Setup 1.1.0.exe", @@ -16,6 +12,10 @@ exports[`squirrel.windows > Squirrel.Windows 1`] = ` "arch": "x64", "file": "TestApp-1.1.0-full.nupkg", }, + { + "arch": "x64", + "file": "RELEASES", + }, ], } `; @@ -61,12 +61,13 @@ exports[`squirrel.windows > artifactName 1`] = ` "win": [ { "arch": "x64", - "file": "RELEASES", + "file": "Test TestApp foo.exe", + "safeArtifactName": "TestApp-Setup-1.1.0.exe", }, { "arch": "x64", - "file": "Test TestApp foo.exe", - "safeArtifactName": "TestApp-Setup-1.1.0.exe", + "file": "Test TestApp foo.zip", + "safeArtifactName": "Test-TestApp-foo.zip", }, { "arch": "x64", @@ -74,8 +75,7 @@ exports[`squirrel.windows > artifactName 1`] = ` }, { "arch": "x64", - "file": "Test TestApp foo.zip", - "safeArtifactName": "Test-TestApp-foo.zip", + "file": "RELEASES", }, ], } @@ -120,10 +120,6 @@ exports[`squirrel.windows > artifactName 2`] = ` exports[`squirrel.windows > squirrel window arm64 msi 1`] = ` { "win": [ - { - "arch": "arm64", - "file": "RELEASES", - }, { "arch": "arm64", "file": "Test App ßW Setup 1.1.0.exe", @@ -138,6 +134,10 @@ exports[`squirrel.windows > squirrel window arm64 msi 1`] = ` "arch": "arm64", "file": "TestApp-1.1.0-full.nupkg", }, + { + "arch": "arm64", + "file": "RELEASES", + }, ], } `; @@ -180,10 +180,6 @@ exports[`squirrel.windows > squirrel window arm64 msi 2`] = ` exports[`squirrel.windows > squirrel window ia32 msi 1`] = ` { "win": [ - { - "arch": "ia32", - "file": "RELEASES", - }, { "arch": "ia32", "file": "Test App ßW Setup 1.1.0.exe", @@ -198,6 +194,10 @@ exports[`squirrel.windows > squirrel window ia32 msi 1`] = ` "arch": "ia32", "file": "TestApp-1.1.0-full.nupkg", }, + { + "arch": "ia32", + "file": "RELEASES", + }, ], } `; @@ -241,10 +241,6 @@ exports[`squirrel.windows > squirrel window ia32 msi 2`] = ` exports[`squirrel.windows > squirrel window x64 msi 1`] = ` { "win": [ - { - "arch": "x64", - "file": "RELEASES", - }, { "arch": "x64", "file": "Test App ßW Setup 1.1.0.exe", @@ -259,6 +255,10 @@ exports[`squirrel.windows > squirrel window x64 msi 1`] = ` "arch": "x64", "file": "TestApp-1.1.0-full.nupkg", }, + { + "arch": "x64", + "file": "RELEASES", + }, ], } `; diff --git a/test/snapshots/windows/winPackagerTest.js.snap b/test/snapshots/windows/winPackagerTest.js.snap index fa1b93b6e3c..118900455dd 100644 --- a/test/snapshots/windows/winPackagerTest.js.snap +++ b/test/snapshots/windows/winPackagerTest.js.snap @@ -4,34 +4,34 @@ exports[`beta version 1`] = ` { "win": [ { - "file": "Test App ßW Setup 3.0.0-beta.2-arm64.exe.blockmap", - "safeArtifactName": "TestApp-Setup-3.0.0-beta.2-arm64.exe.blockmap", + "arch": "x64", + "file": "Test App ßW Setup 3.0.0-beta.2.exe", + "safeArtifactName": "TestApp-Setup-3.0.0-beta.2.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test App ßW Setup 3.0.0-beta.2.exe.blockmap", - "safeArtifactName": "TestApp-Setup-3.0.0-beta.2.exe.blockmap", + "arch": "arm64", + "file": "Test App ßW Setup 3.0.0-beta.2-arm64.exe", + "safeArtifactName": "TestApp-Setup-3.0.0-beta.2-arm64.exe", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "x64", - "file": "Test App ßW Setup 3.0.0-beta.2.exe", - "safeArtifactName": "TestApp-Setup-3.0.0-beta.2.exe", + "file": "Test App ßW Setup 3.0.0-beta.2-arm64.exe.blockmap", + "safeArtifactName": "TestApp-Setup-3.0.0-beta.2-arm64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "arch": "arm64", - "file": "Test App ßW Setup 3.0.0-beta.2-arm64.exe", - "safeArtifactName": "TestApp-Setup-3.0.0-beta.2-arm64.exe", + "file": "Test App ßW Setup 3.0.0-beta.2.exe.blockmap", + "safeArtifactName": "TestApp-Setup-3.0.0-beta.2.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts index 439112a9584..f44f4f70a8f 100644 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -228,17 +228,42 @@ export function getFixtureDir() { * Lower numbers have higher priority in the sort order. */ function getFileTypePriority(file: string): number { + // Primary executables and installers if (file.endsWith(".dmg")) return 1 - if (file.endsWith(".zip")) return 2 - if (file.endsWith(".blockmap")) return 3 - if (file.endsWith(".yml")) return 4 - return 5 + if (file.endsWith(".exe")) return 2 + if (file.endsWith(".msi")) return 3 + if (file.endsWith(".pkg")) return 4 + if (file.endsWith(".deb")) return 5 + if (file.endsWith(".rpm")) return 6 + if (file.endsWith(".AppImage")) return 7 + if (file.endsWith(".appx")) return 8 + if (file.endsWith(".snap")) return 9 + if (file.endsWith(".flatpak")) return 10 + + // Archive formats + if (file.endsWith(".zip")) return 11 + if (file.endsWith(".7z")) return 12 + if (file.endsWith(".tar.gz")) return 13 + if (file.endsWith(".tar.xz")) return 14 + if (file.endsWith(".tar.bz2")) return 15 + + // Package formats + if (file.endsWith(".nupkg")) return 16 + if (file.endsWith(".asar")) return 17 + + // Metadata and auxiliary files + if (file.endsWith(".blockmap")) return 18 + if (file.endsWith(".yml")) return 19 + if (file.endsWith(".yaml")) return 19 + + // Other files + return 20 } /** * Sorts artifacts in a deterministic order for consistent test snapshots. * Sort order: - * 1. Primary: File type (DMG > ZIP > blockmap > YML > others) + * 1. Primary: File type * 2. Secondary: Architecture (x64 > ia32 > arm64 > universal) * 3. Tertiary: Filename (alphabetical) */ From 4ce21b89f02923a47cc505d7eab87514913eb84c Mon Sep 17 00:00:00 2001 From: daihere1993 Date: Mon, 25 Aug 2025 14:36:42 +0800 Subject: [PATCH 3/5] 1. Use an array-based approach to get file type priority 2. Extend sortArtifacts() to support snapshot that include same filename and arch 3. Snapshot adaption for new sorting algorithm --- test/snapshots/concurrentBuildsTest.js.snap | 20 +-- .../updater/blackboxUpdateTest.js.snap | 18 +-- .../updater/differentialUpdateTest.js.snap | 56 ++++----- test/snapshots/windows/appxTest.js.snap | 8 +- .../windows/webInstallerTest.js.snap | 114 +++++++++--------- test/src/helpers/packTester.ts | 88 +++++++++----- 6 files changed, 163 insertions(+), 141 deletions(-) diff --git a/test/snapshots/concurrentBuildsTest.js.snap b/test/snapshots/concurrentBuildsTest.js.snap index a71a7443d49..d3dc676ca7b 100644 --- a/test/snapshots/concurrentBuildsTest.js.snap +++ b/test/snapshots/concurrentBuildsTest.js.snap @@ -552,12 +552,12 @@ exports[`win concurrent - all targets 1`] = ` { "arch": "x64", "file": "Test Concurrent-1.1.0-x64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", + "safeArtifactName": "concurrent-Setup-1.1.0.exe", }, { "arch": "x64", "file": "Test Concurrent-1.1.0-x64.exe", - "safeArtifactName": "concurrent-Setup-1.1.0.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe", }, { "arch": "arm64", @@ -571,12 +571,12 @@ exports[`win concurrent - all targets 1`] = ` { "arch": "arm64", "file": "Test Concurrent-1.1.0-arm64.exe", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", + "safeArtifactName": "concurrent-Setup-1.1.0-arm64.exe", }, { "arch": "arm64", "file": "Test Concurrent-1.1.0-arm64.exe", - "safeArtifactName": "concurrent-Setup-1.1.0-arm64.exe", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe", }, { "arch": "x64", @@ -647,24 +647,24 @@ exports[`win concurrent - all targets 1`] = ` "file": "concurrent-1.1.0-full.nupkg", }, { - "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", + "file": "Test Concurrent-1.1.0.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", + "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", + "file": "Test Concurrent-1.1.0-x64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", diff --git a/test/snapshots/updater/blackboxUpdateTest.js.snap b/test/snapshots/updater/blackboxUpdateTest.js.snap index 9d1eddc9724..643fefe75a8 100644 --- a/test/snapshots/updater/blackboxUpdateTest.js.snap +++ b/test/snapshots/updater/blackboxUpdateTest.js.snap @@ -563,6 +563,15 @@ exports[`Electron autoupdate (fresh install & update) > linux > debian - (dpkg) exports[`Electron autoupdate (fresh install & update) > win 1`] = ` { "win": [ + { + "arch": "x64", + "file": "TestApp Setup.exe", + "safeArtifactName": "TestApp-Setup.exe", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "TestApp Setup.exe.blockmap", "safeArtifactName": "TestApp-Setup.exe.blockmap", @@ -587,15 +596,6 @@ exports[`Electron autoupdate (fresh install & update) > win 1`] = ` "version": "1.0.0", }, }, - { - "arch": "x64", - "file": "TestApp Setup.exe", - "safeArtifactName": "TestApp-Setup.exe", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, ], } `; diff --git a/test/snapshots/updater/differentialUpdateTest.js.snap b/test/snapshots/updater/differentialUpdateTest.js.snap index f17e2ce2887..2395e5e8cc3 100644 --- a/test/snapshots/updater/differentialUpdateTest.js.snap +++ b/test/snapshots/updater/differentialUpdateTest.js.snap @@ -768,6 +768,15 @@ exports[`Mac universal 6`] = ` exports[`nsis 1`] = ` { "win": [ + { + "arch": "x64", + "file": "Test App ßW Setup 1.0.0.exe", + "safeArtifactName": "TestApp-Setup-1.0.0.exe", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "Test App ßW Setup 1.0.0.exe.blockmap", "safeArtifactName": "TestApp-Setup-1.0.0.exe.blockmap", @@ -792,15 +801,6 @@ exports[`nsis 1`] = ` "version": "1.0.0", }, }, - { - "arch": "x64", - "file": "Test App ßW Setup 1.0.0.exe", - "safeArtifactName": "TestApp-Setup-1.0.0.exe", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, ], } `; @@ -870,14 +870,10 @@ exports[`web installer 1`] = ` { "win": [ { - "file": "latest.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "url": "Test App ßW Web Setup 1.0.0.exe", - }, - ], + "arch": "x64", + "file": "Test App ßW Web Setup 1.0.0.exe", + "safeArtifactName": "TestApp-WebSetup-1.0.0.exe", + "updateInfo": { "packages": { "x64": { "blockMapSize": "@blockMapSize", @@ -887,17 +883,21 @@ exports[`web installer 1`] = ` "size": "@size", }, }, - "path": "Test App ßW Web Setup 1.0.0.exe", - "releaseDate": "@releaseDate", - "sha512": "@sha512", - "version": "1.0.0", }, }, { "arch": "x64", - "file": "Test App ßW Web Setup 1.0.0.exe", - "safeArtifactName": "TestApp-WebSetup-1.0.0.exe", - "updateInfo": { + "file": "TestApp-1.0.0-x64.nsis.7z", + }, + { + "file": "latest.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "url": "Test App ßW Web Setup 1.0.0.exe", + }, + ], "packages": { "x64": { "blockMapSize": "@blockMapSize", @@ -907,12 +907,12 @@ exports[`web installer 1`] = ` "size": "@size", }, }, + "path": "Test App ßW Web Setup 1.0.0.exe", + "releaseDate": "@releaseDate", + "sha512": "@sha512", + "version": "1.0.0", }, }, - { - "arch": "x64", - "file": "TestApp-1.0.0-x64.nsis.7z", - }, ], } `; diff --git a/test/snapshots/windows/appxTest.js.snap b/test/snapshots/windows/appxTest.js.snap index 652a88e0a7b..71831f2c9a0 100644 --- a/test/snapshots/windows/appxTest.js.snap +++ b/test/snapshots/windows/appxTest.js.snap @@ -181,13 +181,13 @@ exports[`languages and not signed (windows store only) 1`] = ` { "win": [ { - "arch": "x64", - "file": "Test App ßW 1.1.0.appx", + "arch": "ia32", + "file": "Test App ßW 1.1.0 ia32.appx", "safeArtifactName": "TestApp-1.1.0.appx", }, { - "arch": "ia32", - "file": "Test App ßW 1.1.0 ia32.appx", + "arch": "x64", + "file": "Test App ßW 1.1.0.appx", "safeArtifactName": "TestApp-1.1.0.appx", }, ], diff --git a/test/snapshots/windows/webInstallerTest.js.snap b/test/snapshots/windows/webInstallerTest.js.snap index 6ece0a8cb7b..d8b183c4e2e 100644 --- a/test/snapshots/windows/webInstallerTest.js.snap +++ b/test/snapshots/windows/webInstallerTest.js.snap @@ -3,6 +3,47 @@ exports[`web installer (default github) 1`] = ` { "win": [ + { + "file": "Test App ßW Web Setup 1.1.0.exe", + "safeArtifactName": "TestApp-WebSetup-1.1.0.exe", + "updateInfo": { + "packages": { + "arm64": { + "blockMapSize": "@blockMapSize", + "file": "TestApp-1.1.0-arm64.nsis.7z", + "path": "TestApp-1.1.0-arm64.nsis.7z", + "sha512": "@sha512", + "size": "@size", + }, + "ia32": { + "blockMapSize": "@blockMapSize", + "file": "TestApp-1.1.0-ia32.nsis.7z", + "path": "TestApp-1.1.0-ia32.nsis.7z", + "sha512": "@sha512", + "size": "@size", + }, + "x64": { + "blockMapSize": "@blockMapSize", + "file": "TestApp-1.1.0-x64.nsis.7z", + "path": "TestApp-1.1.0-x64.nsis.7z", + "sha512": "@sha512", + "size": "@size", + }, + }, + }, + }, + { + "arch": "ia32", + "file": "TestApp-1.1.0-ia32.nsis.7z", + }, + { + "arch": "x64", + "file": "TestApp-1.1.0-x64.nsis.7z", + }, + { + "arch": "arm64", + "file": "TestApp-1.1.0-arm64.nsis.7z", + }, { "file": "latest.yml", "fileContent": { @@ -41,6 +82,13 @@ exports[`web installer (default github) 1`] = ` "version": "1.1.0", }, }, + ], +} +`; + +exports[`web installer 1`] = ` +{ + "win": [ { "file": "Test App ßW Web Setup 1.1.0.exe", "safeArtifactName": "TestApp-WebSetup-1.1.0.exe", @@ -53,13 +101,6 @@ exports[`web installer (default github) 1`] = ` "sha512": "@sha512", "size": "@size", }, - "ia32": { - "blockMapSize": "@blockMapSize", - "file": "TestApp-1.1.0-ia32.nsis.7z", - "path": "TestApp-1.1.0-ia32.nsis.7z", - "sha512": "@sha512", - "size": "@size", - }, "x64": { "blockMapSize": "@blockMapSize", "file": "TestApp-1.1.0-x64.nsis.7z", @@ -70,10 +111,6 @@ exports[`web installer (default github) 1`] = ` }, }, }, - { - "arch": "ia32", - "file": "TestApp-1.1.0-ia32.nsis.7z", - }, { "arch": "x64", "file": "TestApp-1.1.0-x64.nsis.7z", @@ -82,13 +119,6 @@ exports[`web installer (default github) 1`] = ` "arch": "arm64", "file": "TestApp-1.1.0-arm64.nsis.7z", }, - ], -} -`; - -exports[`web installer 1`] = ` -{ - "win": [ { "file": "latest.yml", "fileContent": { @@ -120,18 +150,18 @@ exports[`web installer 1`] = ` "version": "1.1.0", }, }, + ], +} +`; + +exports[`web installer, safe name on github 1`] = ` +{ + "win": [ { - "file": "Test App ßW Web Setup 1.1.0.exe", - "safeArtifactName": "TestApp-WebSetup-1.1.0.exe", + "arch": "x64", + "file": "WorkFlowy.exe", "updateInfo": { "packages": { - "arm64": { - "blockMapSize": "@blockMapSize", - "file": "TestApp-1.1.0-arm64.nsis.7z", - "path": "TestApp-1.1.0-arm64.nsis.7z", - "sha512": "@sha512", - "size": "@size", - }, "x64": { "blockMapSize": "@blockMapSize", "file": "TestApp-1.1.0-x64.nsis.7z", @@ -146,17 +176,6 @@ exports[`web installer 1`] = ` "arch": "x64", "file": "TestApp-1.1.0-x64.nsis.7z", }, - { - "arch": "arm64", - "file": "TestApp-1.1.0-arm64.nsis.7z", - }, - ], -} -`; - -exports[`web installer, safe name on github 1`] = ` -{ - "win": [ { "file": "latest.yml", "fileContent": { @@ -181,25 +200,6 @@ exports[`web installer, safe name on github 1`] = ` "version": "1.1.0", }, }, - { - "arch": "x64", - "file": "TestApp-1.1.0-x64.nsis.7z", - }, - { - "arch": "x64", - "file": "WorkFlowy.exe", - "updateInfo": { - "packages": { - "x64": { - "blockMapSize": "@blockMapSize", - "file": "TestApp-1.1.0-x64.nsis.7z", - "path": "TestApp-1.1.0-x64.nsis.7z", - "sha512": "@sha512", - "size": "@size", - }, - }, - }, - }, ], } `; diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts index f44f4f70a8f..4837043b7fa 100644 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -228,44 +228,49 @@ export function getFixtureDir() { * Lower numbers have higher priority in the sort order. */ function getFileTypePriority(file: string): number { - // Primary executables and installers - if (file.endsWith(".dmg")) return 1 - if (file.endsWith(".exe")) return 2 - if (file.endsWith(".msi")) return 3 - if (file.endsWith(".pkg")) return 4 - if (file.endsWith(".deb")) return 5 - if (file.endsWith(".rpm")) return 6 - if (file.endsWith(".AppImage")) return 7 - if (file.endsWith(".appx")) return 8 - if (file.endsWith(".snap")) return 9 - if (file.endsWith(".flatpak")) return 10 - - // Archive formats - if (file.endsWith(".zip")) return 11 - if (file.endsWith(".7z")) return 12 - if (file.endsWith(".tar.gz")) return 13 - if (file.endsWith(".tar.xz")) return 14 - if (file.endsWith(".tar.bz2")) return 15 - - // Package formats - if (file.endsWith(".nupkg")) return 16 - if (file.endsWith(".asar")) return 17 - - // Metadata and auxiliary files - if (file.endsWith(".blockmap")) return 18 - if (file.endsWith(".yml")) return 19 - if (file.endsWith(".yaml")) return 19 - - // Other files - return 20 + const ordering = [ + // Primary executables and installers + ".dmg", + ".exe", + ".msi", + ".pkg", + ".deb", + ".rpm", + ".AppImage", + ".appx", + ".snap", + ".flatpak", + + // Archive formats + ".zip", + ".7z", + ".tar.gz", + ".tar.xz", + ".tar.bz2", + + // Package formats + ".nupkg", + ".asar", + + // Metadata and auxiliary files + ".blockmap", + ".yml", + ".yaml", + ] + + const index = ordering.findIndex(ext => file.endsWith(ext)) + // If found, return priority (1-based index), otherwise return highest value for "other files" + return index === -1 ? ordering.length + 1 : index + 1 } /** * Sorts artifacts in a deterministic order for consistent test snapshots. * Sort order: - * 1. Primary: File type - * 2. Secondary: Architecture (x64 > ia32 > arm64 > universal) + * 1. Primary: File type (by extension priority) + * 2. Secondary: Architecture (ia32 < x64 < armv7l < arm64 < universal) * 3. Tertiary: Filename (alphabetical) + * 4. Quaternary: Presence of updateInfo (with updateInfo < without updateInfo) + * 5. Quinary: Safe artifact name (alphabetical) */ function sortArtifacts(a: ArtifactCreated, b: ArtifactCreated): number { // Primary sort: by file extension type @@ -288,7 +293,24 @@ function sortArtifacts(a: ArtifactCreated, b: ArtifactCreated): number { // Tertiary sort: by filename const baseNameA = path.basename(fileA) const baseNameB = path.basename(fileB) - return baseNameA.localeCompare(baseNameB, "en") + const fileNameCompare = baseNameA.localeCompare(baseNameB, "en") + if (fileNameCompare !== 0) { + return fileNameCompare + } + + // Quaternary sort: by presence of updateInfo (with updateInfo comes first) + const hasUpdateInfoA = a.updateInfo ? 0 : 1 + const hasUpdateInfoB = b.updateInfo ? 0 : 1 + + if (hasUpdateInfoA !== hasUpdateInfoB) { + return hasUpdateInfoA - hasUpdateInfoB + } + + // Quinary sort: by safeArtifactName (final tiebreaker) + const safeNameA = a.safeArtifactName ?? "" + const safeNameB = b.safeArtifactName ?? "" + + return safeNameA.localeCompare(safeNameB, "en") } async function packAndCheck(expect: ExpectStatic, packagerOptions: PackagerOptions, checkOptions: AssertPackOptions) { From 95153d57aaa2360626128ea363f20809520520dd Mon Sep 17 00:00:00 2001 From: daihere1993 Date: Mon, 25 Aug 2025 14:47:13 +0800 Subject: [PATCH 4/5] refine code --- test/src/helpers/packTester.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts index 4837043b7fa..c78b33b2da0 100644 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -259,8 +259,8 @@ function getFileTypePriority(file: string): number { ] const index = ordering.findIndex(ext => file.endsWith(ext)) - // If found, return priority (1-based index), otherwise return highest value for "other files" - return index === -1 ? ordering.length + 1 : index + 1 + // If found, return the index (0-based), otherwise return highest value for "other files" + return index === -1 ? ordering.length : index } /** From 6d3ff660390de4045244aa93eb5c4801c107ab9c Mon Sep 17 00:00:00 2001 From: daihere1993 Date: Wed, 27 Aug 2025 16:38:08 +0800 Subject: [PATCH 5/5] fix: failed tests --- test/snapshots/concurrentBuildsTest.js.snap | 12 ++-- .../updater/blackboxUpdateTest.js.snap | 18 +++--- .../updater/differentialUpdateTest.js.snap | 56 +++++++++---------- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/test/snapshots/concurrentBuildsTest.js.snap b/test/snapshots/concurrentBuildsTest.js.snap index d3dc676ca7b..d64299bbcbe 100644 --- a/test/snapshots/concurrentBuildsTest.js.snap +++ b/test/snapshots/concurrentBuildsTest.js.snap @@ -647,24 +647,24 @@ exports[`win concurrent - all targets 1`] = ` "file": "concurrent-1.1.0-full.nupkg", }, { - "file": "Test Concurrent-1.1.0.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", + "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-arm64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-arm64.exe.blockmap", + "file": "Test Concurrent-1.1.0-x64.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", }, }, { - "file": "Test Concurrent-1.1.0-x64.exe.blockmap", - "safeArtifactName": "Test-Concurrent-1.1.0-x64.exe.blockmap", + "file": "Test Concurrent-1.1.0.exe.blockmap", + "safeArtifactName": "Test-Concurrent-1.1.0.exe.blockmap", "updateInfo": { "sha512": "@sha512", "size": "@size", diff --git a/test/snapshots/updater/blackboxUpdateTest.js.snap b/test/snapshots/updater/blackboxUpdateTest.js.snap index 643fefe75a8..fb59322067e 100644 --- a/test/snapshots/updater/blackboxUpdateTest.js.snap +++ b/test/snapshots/updater/blackboxUpdateTest.js.snap @@ -603,6 +603,15 @@ exports[`Electron autoupdate (fresh install & update) > win 1`] = ` exports[`Electron autoupdate (fresh install & update) > win 2`] = ` { "win": [ + { + "arch": "x64", + "file": "TestApp Setup.exe", + "safeArtifactName": "TestApp-Setup.exe", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "TestApp Setup.exe.blockmap", "safeArtifactName": "TestApp-Setup.exe.blockmap", @@ -627,15 +636,6 @@ exports[`Electron autoupdate (fresh install & update) > win 2`] = ` "version": "1.0.1", }, }, - { - "arch": "x64", - "file": "TestApp Setup.exe", - "safeArtifactName": "TestApp-Setup.exe", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, ], } `; diff --git a/test/snapshots/updater/differentialUpdateTest.js.snap b/test/snapshots/updater/differentialUpdateTest.js.snap index 2395e5e8cc3..61492b7412b 100644 --- a/test/snapshots/updater/differentialUpdateTest.js.snap +++ b/test/snapshots/updater/differentialUpdateTest.js.snap @@ -808,6 +808,15 @@ exports[`nsis 1`] = ` exports[`nsis 2`] = ` { "win": [ + { + "arch": "x64", + "file": "Test App ßW Setup 1.0.1.exe", + "safeArtifactName": "TestApp-Setup-1.0.1.exe", + "updateInfo": { + "sha512": "@sha512", + "size": "@size", + }, + }, { "file": "Test App ßW Setup 1.0.1.exe.blockmap", "safeArtifactName": "TestApp-Setup-1.0.1.exe.blockmap", @@ -832,15 +841,6 @@ exports[`nsis 2`] = ` "version": "1.0.1", }, }, - { - "arch": "x64", - "file": "Test App ßW Setup 1.0.1.exe", - "safeArtifactName": "TestApp-Setup-1.0.1.exe", - "updateInfo": { - "sha512": "@sha512", - "size": "@size", - }, - }, ], } `; @@ -921,14 +921,10 @@ exports[`web installer 2`] = ` { "win": [ { - "file": "latest.yml", - "fileContent": { - "files": [ - { - "sha512": "@sha512", - "url": "Test App ßW Web Setup 1.0.1.exe", - }, - ], + "arch": "x64", + "file": "Test App ßW Web Setup 1.0.1.exe", + "safeArtifactName": "TestApp-WebSetup-1.0.1.exe", + "updateInfo": { "packages": { "x64": { "blockMapSize": "@blockMapSize", @@ -938,17 +934,21 @@ exports[`web installer 2`] = ` "size": "@size", }, }, - "path": "Test App ßW Web Setup 1.0.1.exe", - "releaseDate": "@releaseDate", - "sha512": "@sha512", - "version": "1.0.1", }, }, { "arch": "x64", - "file": "Test App ßW Web Setup 1.0.1.exe", - "safeArtifactName": "TestApp-WebSetup-1.0.1.exe", - "updateInfo": { + "file": "TestApp-1.0.1-x64.nsis.7z", + }, + { + "file": "latest.yml", + "fileContent": { + "files": [ + { + "sha512": "@sha512", + "url": "Test App ßW Web Setup 1.0.1.exe", + }, + ], "packages": { "x64": { "blockMapSize": "@blockMapSize", @@ -958,12 +958,12 @@ exports[`web installer 2`] = ` "size": "@size", }, }, + "path": "Test App ßW Web Setup 1.0.1.exe", + "releaseDate": "@releaseDate", + "sha512": "@sha512", + "version": "1.0.1", }, }, - { - "arch": "x64", - "file": "TestApp-1.0.1-x64.nsis.7z", - }, ], } `;