Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: npm test is failing Windows tests on M1 Macs #3011

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,15 @@ jobs:
fail-fast: false
max-parallel: 15
matrix:
os: [macos, ubuntu, windows]
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.8", "3.10", "3.12"]
node: [16.x, 18.x, 20.x]
include: # `npm test` is running Windows find-visualstudio tests on an M1 Mac!!!
- os: macos-14
python: "3.12"
node: 20.x
name: ${{ matrix.os }} - ${{ matrix.python }} - ${{ matrix.node }}
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -116,20 +120,20 @@ jobs:
npm install
pip install pytest
- name: Set Windows Env
if: runner.os == 'Windows'
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Run Python Tests
run: python -m pytest
- name: Run Tests (macOS or Linux)
if: runner.os != 'Windows'
if: "!startsWith(matrix.os, 'windows')"
shell: bash
run: npm test --python="${pythonLocation}/python"
env:
FULL_TEST: ${{ (matrix.node == '20.x' && matrix.python == '3.12') && '1' || '0' }}
- name: Run Tests (Windows)
if: runner.os == 'Windows'
if: startsWith(matrix.os, 'windows')
shell: pwsh
run: npm run test --python="${env:pythonLocation}\\python.exe"
env:
Expand Down
6 changes: 6 additions & 0 deletions test/test-find-visualstudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ class TestVisualStudioFinder extends VisualStudioFinder {
}
}

const shouldSkip = process.platform !== 'win32'

describe('find-visualstudio', function () {
if (shouldSkip) {
return
}

this.beforeAll(function () {
// Condition to skip the test suite
if (process.env.SystemRoot === undefined) {
Expand Down