From 8d1dc810392d407cd7eb5782141dde1dad832a85 Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 26 Dec 2024 10:14:51 -0500 Subject: [PATCH] Fix runInBand arg ignored on Windows + Node 22 Signed-off-by: Timothy Johnson --- .github/workflows/zowe-cli.yml | 39 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/zowe-cli.yml b/.github/workflows/zowe-cli.yml index b5a6b4992..122786b64 100644 --- a/.github/workflows/zowe-cli.yml +++ b/.github/workflows/zowe-cli.yml @@ -9,13 +9,19 @@ on: workflow_dispatch: inputs: binary-type: + type: choice description: Specify whether to use a `debug` or a `release` version of the binary default: debug - required: false + options: + - debug + - release test-type: + type: choice description: Specify whether to run tests using the `binary` or regular `nodejs` executable default: binary - required: false + options: + - binary + - nodejs macos-type: type: choice description: Run against x86-based MacOS (12), otherwise run against ARM64-based MacOS (14) @@ -66,20 +72,12 @@ jobs: echo "::remove-matcher owner=eslint-compact::" echo "::remove-matcher owner=eslint-stylish::" - - name: Get NPM Version - id: npm-version - run: echo "number=$(npm --version)" >> $GITHUB_OUTPUT - - name: Install Dependencies run: npm ci - - name: Use Original NPM Version - id: original-npm-version - run: npm install -g npm@${{ steps.npm-version.outputs.number || '9' }} - - name: Install Rust toolchain id: install-rust - if: github.event.inputs.test-type == 'binary' || github.event_name == 'push' + if: github.event.inputs.test-type != 'nodejs' uses: dtolnay/rust-toolchain@stable - name: Build Source @@ -88,14 +86,14 @@ jobs: - name: Build Binary id: build-binary - if: matrix.os != 'windows-latest' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') + if: matrix.os != 'windows-latest' && github.event.inputs.test-type != 'nodejs' run: | cargo build --verbose ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml tar -cvzf zowe.tgz -C zowex/target/${{ github.event.inputs.binary-type == 'release' && 'release' || 'debug' }} zowe - name: Build Binary (Windows) id: build-windows-binary - if: matrix.os == 'windows-latest' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') + if: matrix.os == 'windows-latest' && github.event.inputs.test-type != 'nodejs' run: | cargo build --verbose ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml tar -cvzf zowe.tgz -C zowex/target/${{ github.event.inputs.binary-type == 'release' && 'release' || 'debug' }} zowe.exe @@ -103,7 +101,7 @@ jobs: RUSTFLAGS: "-Ctarget-feature=+crt-static" - name: Archive Binary - if: github.event.inputs.test-type == 'binary' || github.event_name == 'push' + if: github.event.inputs.test-type != 'nodejs' id: upload-binary uses: actions/upload-artifact@v4 with: @@ -112,7 +110,7 @@ jobs: overwrite: true - name: Setup Binary in PATH - if: github.event.inputs.test-type == 'binary' || github.event_name == 'push' + if: github.event.inputs.test-type != 'nodejs' id: setup-binary shell: bash run: | @@ -121,7 +119,7 @@ jobs: - name: Test Rust EXE and zowe script id: test-exe-and-script - if: ${{ steps.setup-binary.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }} + if: ${{ steps.setup-binary.outcome == 'success' && github.event.inputs.test-type != 'nodejs' }} run: cargo test ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml -- --nocapture - name: Unit Tests @@ -135,16 +133,17 @@ jobs: - name: Start Daemon id: start-daemon - if: ${{ always() && steps.build.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }} + if: ${{ always() && steps.build.outcome == 'success' && github.event.inputs.test-type != 'nodejs' }} run: ./__tests__/__resources__/daemon_instances/zowe - name: Integration Tests (Native) - if: ${{ always() && steps.build.outcome == 'success' && !(github.event.inputs.test-type == 'binary' || github.event_name == 'push') }} + if: ${{ always() && steps.build.outcome == 'success' && github.event.inputs.test-type == 'nodejs' }} run: npm run test:integration - name: Integration Tests (Daemon) - if: ${{ always() && steps.build.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }} - run: npm run test:integration -- --runInBand + if: ${{ always() && steps.build.outcome == 'success' && github.event.inputs.test-type != 'nodejs' }} + # We need double double hyphen to work around Windows + Node 22 bug: https://github.com/npm/cli/issues/7375 + run: npm run test:integration -- -- --runInBand - name: Archive Results if: ${{ always() && steps.build.outcome == 'success' }}