From 554968fd1d815fc46d603d77b3d9b15c71cd3e1e Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 13 Feb 2024 00:53:08 +0000 Subject: [PATCH] ci: skip ruby standalone tests on arm64 linux due to qemu errors --- .github/workflows/build-and-test.yml | 6 +++++- src/can-deploy/can-deploy.spec.ts | 2 +- src/message.spec.ts | 2 +- src/pact-standalone.spec.ts | 2 +- src/pact.spec.ts | 2 +- src/publisher.spec.ts | 2 +- src/server.spec.ts | 2 +- src/stub.spec.ts | 2 +- standalone/install.ts | 2 +- test/publisher.integration.spec.ts | 2 +- 10 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ec701496..8a56bf18 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -198,12 +198,16 @@ jobs: - if: runner.os == 'Windows' run: echo "ONLY_DOWNLOAD_PACT_FOR_WINDOWS=true" >> $GITHUB_ENV + - if: runner.os == 'Linux' && matrix.docker == 'true' && matrix.arch == 'arm64' + run: echo "SKIP_STANDALONE=true" >> $GITHUB_ENV + - run: FETCH_ASSETS=true REPO=you54f/pact-js-core ./script/ci/check-release-libs.sh --fetch-assets -t v15.0.0 env: GITHUB_TOKEN: ${{ github.token }} - run: ./script/ci/download-standalone-and-test.sh if: matrix.docker != true + # Linux aarch64 tests are skipped as QEMU fails when executing the ruby binaries # Related comment: https://github.com/phusion/passenger/issues/2288#issuecomment-1387625121 - name: Set up QEMU @@ -217,7 +221,7 @@ jobs: run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} --rm node:${{ matrix.node-version }} /bin/bash -c 'npm config set cache /tmp && apt install -y shared-mime-info && cd /home/node/app && ./script/ci/download-standalone-and-test.sh' - if: runner.os == 'Linux' && matrix.docker == true && matrix.musl == true name: test linux ${{ matrix.arch }} musl # Setting the cache location is a workaround for node 16 install errors https://github.com/npm/cli/issues/5114 - run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} --rm node:${{ matrix.node-version }}-alpine /bin/sh -c 'npm config set cache /tmp && apk add bash curl shared-mime-info && cd /home/node/app && ./script/ci/download-standalone-and-test.sh' + run: docker run -v $PWD:/home/node/app --platform linux/${{ matrix.arch }} --rm node:${{ matrix.node-version }}-alpine /bin/sh -c 'npm config set cache /tmp && apk add bash curl shared-mime-info gcompat libc6-compat gzip file protoc protobuf-dev && cd /home/node/app && ./script/ci/download-standalone-and-test.sh' # release_dry_run: # runs-on: ubuntu-latest diff --git a/src/can-deploy/can-deploy.spec.ts b/src/can-deploy/can-deploy.spec.ts index 88721cca..ac404b88 100644 --- a/src/can-deploy/can-deploy.spec.ts +++ b/src/can-deploy/can-deploy.spec.ts @@ -14,7 +14,7 @@ import brokerMock from '../../test/integration/broker-mock'; const { expect } = chai; chai.use(chaiAsPromised); -describe.skip('CanDeploy Spec', () => { +(process.env['SKIP_STANDALONE'] === "true" ? describe.skip : describe )('CanDeploy Spec', () => { const PORT = Math.floor(Math.random() * 999) + 9000; let server: http.Server; let absolutePath: string; diff --git a/src/message.spec.ts b/src/message.spec.ts index 8745b7b5..1541c37b 100644 --- a/src/message.spec.ts +++ b/src/message.spec.ts @@ -9,7 +9,7 @@ import messageFactory from './message'; const { expect } = chai; chai.use(chaiAsPromised); -describe.skip('Message Spec', () => { +(process.env['SKIP_STANDALONE'] === "true" ? describe.skip : describe )('Message Spec', () => { const validJSON = `{ "description": "a test mesage", "content": { "name": "Mary" } }`; let absolutePath: string; diff --git a/src/pact-standalone.spec.ts b/src/pact-standalone.spec.ts index eea04f79..31d46453 100644 --- a/src/pact-standalone.spec.ts +++ b/src/pact-standalone.spec.ts @@ -8,7 +8,7 @@ const { expect } = chai; const basePath = pactEnvironment.cwd; // Needs to stay a function and not an arrow function to access mocha 'this' context -describe.skip('Pact Standalone', function forMocha() { +(process.env['SKIP_STANDALONE'] === "true" ? describe.skip : describe )('Pact Standalone', function forMocha() { // Set timeout to 10 minutes because downloading binaries might take a while. this.timeout(600000); diff --git a/src/pact.spec.ts b/src/pact.spec.ts index 2ceb91b3..da34eaaf 100644 --- a/src/pact.spec.ts +++ b/src/pact.spec.ts @@ -8,7 +8,7 @@ import { ServerOptions } from '.'; const { expect } = chai; chai.use(chaiAsPromised); -describe.skip('Pact Spec', () => { +(process.env['SKIP_STANDALONE'] === "true" ? describe.skip : describe )('Pact Spec', () => { afterEach(() => pact.removeAllServers()); describe('Set Log Level', () => { diff --git a/src/publisher.spec.ts b/src/publisher.spec.ts index 404b79c1..dea31e1a 100644 --- a/src/publisher.spec.ts +++ b/src/publisher.spec.ts @@ -13,7 +13,7 @@ import { PublisherOptions } from './types'; const { expect } = chai; chai.use(chaiAsPromised); -describe.skip('Publish Spec', () => { +(process.env['SKIP_STANDALONE'] === "true" ? describe.skip : describe )('Publish Spec', () => { const PORT = Math.floor(Math.random() * 999) + 9000; const pactFile = path.resolve( __dirname, diff --git a/src/server.spec.ts b/src/server.spec.ts index c5624403..0b60e029 100644 --- a/src/server.spec.ts +++ b/src/server.spec.ts @@ -11,7 +11,7 @@ chai.use(chaiAsPromised); const { expect } = chai; const rm = util.promisify(rimraf); -describe.skip('Server Spec', () => { +(process.env['SKIP_STANDALONE'] === "true" ? describe.skip : describe )('Server Spec', () => { let server: any; const monkeypatchFile: string = path.resolve( __dirname, diff --git a/src/stub.spec.ts b/src/stub.spec.ts index 5b6d4908..38c944b2 100644 --- a/src/stub.spec.ts +++ b/src/stub.spec.ts @@ -7,7 +7,7 @@ import stubFactory from './stub'; chai.use(chaiAsPromised); const { expect } = chai; -describe.skip('Stub Spec', () => { +(process.env['SKIP_STANDALONE'] === "true" ? describe.skip : describe )('Stub Spec', () => { let stub: any; const validDefaults = { pactUrls: [ diff --git a/standalone/install.ts b/standalone/install.ts index e7e7a5bf..0d41bfd6 100644 --- a/standalone/install.ts +++ b/standalone/install.ts @@ -1,7 +1,7 @@ import chalk = require('chalk'); // Get latest version from https://github.com/pact-foundation/pact-ruby-standalone/releases -export const PACT_STANDALONE_VERSION = '2.4.0'; +export const PACT_STANDALONE_VERSION = '2.3.1'; function makeError(msg: string): Error { return new Error(chalk.red(`Error while locating pact binary: ${msg}`)); diff --git a/test/publisher.integration.spec.ts b/test/publisher.integration.spec.ts index 893d4563..5c5d37ab 100644 --- a/test/publisher.integration.spec.ts +++ b/test/publisher.integration.spec.ts @@ -9,7 +9,7 @@ import brokerMock from './integration/broker-mock'; const { expect } = chai; chai.use(chaiAsPromised); -describe.skip('Publish Spec', () => { +(process.env['SKIP_STANDALONE'] === "true" ? describe.skip : describe )('Publish Spec', () => { let server: http.Server; const PORT = Math.floor(Math.random() * 999) + 9000; const pactBrokerBaseUrl = `http://localhost:${PORT}`;