From 5779a857ad4bab0959ed954350c944b150277f6f Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Thu, 4 Jan 2024 08:41:59 -0700 Subject: [PATCH] testing CI --- packages/signing-utils/src/index.spec.ts | 0 packages/signing-utils/src/mocha-hooks.ts | 3 +-- .../src/signing-clients/local-signing-client.spec.ts | 1 - .../signing-utils/src/signing-clients/local-signing-client.ts | 3 +++ .../src/signing-clients/remote-signing-client.spec.ts | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 packages/signing-utils/src/index.spec.ts diff --git a/packages/signing-utils/src/index.spec.ts b/packages/signing-utils/src/index.spec.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/signing-utils/src/mocha-hooks.ts b/packages/signing-utils/src/mocha-hooks.ts index 9404ff6c..751a9838 100644 --- a/packages/signing-utils/src/mocha-hooks.ts +++ b/packages/signing-utils/src/mocha-hooks.ts @@ -3,8 +3,7 @@ import * as os from 'os'; export const mochaHooks: { beforeEach: Mocha.HookFunction } = { beforeEach() { if (!os.platform().toLowerCase().includes('linux')) { - // @ts-expect-error TS does not know mocha will properly set `this` when it invokes beforeEach - this.skip(); + // this.skip(); return true; } }, diff --git a/packages/signing-utils/src/signing-clients/local-signing-client.spec.ts b/packages/signing-utils/src/signing-clients/local-signing-client.spec.ts index 0baf17d3..c74251a8 100644 --- a/packages/signing-utils/src/signing-clients/local-signing-client.spec.ts +++ b/packages/signing-utils/src/signing-clients/local-signing-client.spec.ts @@ -19,7 +19,6 @@ describe('LocalSigningClient', function () { echo "signed content" > ${fileNameAfterGpgSigning} ` ); - execSync(`chmod +x ${signingScript}`); await fs.writeFile(fileToSign, 'original content'); }); diff --git a/packages/signing-utils/src/signing-clients/local-signing-client.ts b/packages/signing-utils/src/signing-clients/local-signing-client.ts index afbf4d1a..2e7c4b87 100644 --- a/packages/signing-utils/src/signing-clients/local-signing-client.ts +++ b/packages/signing-utils/src/signing-clients/local-signing-client.ts @@ -3,6 +3,7 @@ import { execFile } from 'child_process'; import { promisify } from 'util'; import { debug, getEnv, signedFileName } from '../utils'; import type { SigningClient, SigningClientOptions } from '.'; +import { chmod } from 'fs/promises'; const localClientDebug = debug.extend('LocalSigningClient'); const execFileAsync = promisify(execFile); @@ -21,6 +22,8 @@ export class LocalSigningClient implements SigningClient { const directoryOfFileToSign = path.dirname(file); + await chmod(this.options.signingScript, 0o755); + try { const env = { ...getEnv(), diff --git a/packages/signing-utils/src/signing-clients/remote-signing-client.spec.ts b/packages/signing-utils/src/signing-clients/remote-signing-client.spec.ts index 5031c02a..4b10b33d 100644 --- a/packages/signing-utils/src/signing-clients/remote-signing-client.spec.ts +++ b/packages/signing-utils/src/signing-clients/remote-signing-client.spec.ts @@ -87,7 +87,7 @@ describe('RemoteSigningClient', function () { } const remoteSigningClient = new RemoteSigningClient(getMockedSSHClient(), { - rootDir: tmpDir, + workingDirectory: tmpDir, signingScript: signingScript, signingMethod: 'gpg', });