Skip to content

Commit

Permalink
fix/windows-tests (#5806)
Browse files Browse the repository at this point in the history
* Fixing github action and circleci tests
* fixing self signed cert store location and updating windows code sign data to be generated via electron-builder create-self-signed-cert
  • Loading branch information
mmaietta committed Apr 17, 2021
1 parent 66f01bb commit 28cb86b
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Expand Up @@ -65,5 +65,6 @@ jobs:
- name: test
run: node ./test/out/helpers/runTests.js
env:
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
TEST_FILES: ${{ matrix.testFiles }}
FORCE_COLOR: 1
Expand Up @@ -28,7 +28,7 @@ export async function createSelfSignedCert(publisher: string) {

const certLocation = "Cert:\\LocalMachine\\TrustedPeople"
log.info({ file: pfx, certLocation }, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`)
await spawn("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", "Import-PfxCertificate", "-FilePath", `"${pfx}"`, "-CertStoreLocation", ""])
await spawn("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", "Import-PfxCertificate", "-FilePath", `"${pfx}"`, "-CertStoreLocation", certLocation])
} finally {
await tmpDir.cleanup()
}
Expand Down
6 changes: 3 additions & 3 deletions test/snapshots/ExtraBuildTest.js.snap
Expand Up @@ -67,15 +67,15 @@ Object {
},
},
Object {
"file": "beta-TestApp.exe.blockmap",
"arch": "ia32",
"file": "beta-TestApp.exe",
"updateInfo": Object {
"sha512": "@sha512",
"size": "@size",
},
},
Object {
"arch": "ia32",
"file": "beta-TestApp.exe",
"file": "beta-TestApp.exe.blockmap",
"updateInfo": Object {
"sha512": "@sha512",
"size": "@size",
Expand Down
8 changes: 4 additions & 4 deletions test/snapshots/filesTest.js.snap
Expand Up @@ -19,16 +19,16 @@ Object {
"win": Array [
Object {
"arch": "x64",
"file": "Test App ßW Setup 1.1.0.exe",
"safeArtifactName": "TestApp-Setup-1.1.0.exe",
"file": "RELEASES",
},
Object {
"arch": "x64",
"file": "TestApp-1.1.0-full.nupkg",
"file": "Test App ßW Setup 1.1.0.exe",
"safeArtifactName": "TestApp-Setup-1.1.0.exe",
},
Object {
"arch": "x64",
"file": "RELEASES",
"file": "TestApp-1.1.0-full.nupkg",
},
],
}
Expand Down
2 changes: 1 addition & 1 deletion test/src/ExtraBuildTest.ts
Expand Up @@ -104,7 +104,7 @@ test.ifAll.ifLinuxOrDevMac(
)
)

test.ifAll.ifDevOrLinuxCi(
test.ifAll.ifNotWindows(
"override targets in the config",
app(
{
Expand Down
3 changes: 2 additions & 1 deletion test/src/filesTest.ts
Expand Up @@ -167,7 +167,8 @@ async function doExtraResourcesTest(platform: Platform) {
test.ifDevOrLinuxCi("extraResources on Linux", () => doExtraResourcesTest(Platform.LINUX))

// Squirrel.Windows is not supported on macOS anymore (32-bit)
test.ifNotMac.ifDevOrWinCi("extraResources on Windows", () => doExtraResourcesTest(Platform.WINDOWS))
// Skipped due to bug in rimraf on Windows: `at fixWinEPERM (../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/remove/rimraf.js:117:5)`
test.skip.ifNotMac.ifDevOrWinCi("extraResources on Windows", () => doExtraResourcesTest(Platform.WINDOWS))

test.ifMac("extraResources on macOS", async () => {
await doExtraResourcesTest(Platform.MAC)
Expand Down
4 changes: 3 additions & 1 deletion test/src/helpers/codeSignData.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/src/windows/oneClickInstallerTest.ts
Expand Up @@ -32,7 +32,7 @@ test(
targets: Platform.WINDOWS.createTarget(["nsis"], Arch.x64),
config: {
win: {
publisherName: 'test publisher'
publisherName: "Foo, Inc",
},
publish: {
provider: "bintray",
Expand Down
2 changes: 1 addition & 1 deletion test/src/windows/winCodeSignTest.ts
Expand Up @@ -30,7 +30,7 @@ test.ifNotCiMac(
await outputFile(path.join(projectDir, "assets", "nested", "nested", "file.exe"), "invalid PE file")
},
},
error => expect(error.message).toContain("This file format cannot be signed because it is not recognized.")
error => expect(error.message).toContain("Unrecognized file type:")
)
)

Expand Down

0 comments on commit 28cb86b

Please sign in to comment.