Skip to content

Commit 0bab6a0

Browse files
GitHub Actions: npm test is failing Windows tests on M1 Macs (#3011)
* GitHub Actions: npm test is failing Windows tests on M1 Macs `npm test` is running and failing Windows `find-visualstudio` tests on an M1 Mac!!! These tests are not being run or not failing on Intel Macs. * Only run "Find Visual Studio" tests on Windows * Update test/test-find-visualstudio.js Co-authored-by: Christian Clauss <[email protected]> --------- Co-authored-by: Stefan Stojanovic <[email protected]>
1 parent 77737e4 commit 0bab6a0

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,15 @@ jobs:
9393
fail-fast: false
9494
max-parallel: 15
9595
matrix:
96-
os: [macos, ubuntu, windows]
96+
os: [macos-latest, ubuntu-latest, windows-latest]
9797
python: ["3.8", "3.10", "3.12"]
9898
node: [16.x, 18.x, 20.x]
99+
include: # `npm test` is running Windows find-visualstudio tests on an M1 Mac!!!
100+
- os: macos-14
101+
python: "3.12"
102+
node: 20.x
99103
name: ${{ matrix.os }} - ${{ matrix.python }} - ${{ matrix.node }}
100-
runs-on: ${{ matrix.os }}-latest
104+
runs-on: ${{ matrix.os }}
101105
steps:
102106
- name: Checkout Repository
103107
uses: actions/checkout@v4
@@ -116,20 +120,20 @@ jobs:
116120
npm install
117121
pip install pytest
118122
- name: Set Windows Env
119-
if: runner.os == 'Windows'
123+
if: startsWith(matrix.os, 'windows')
120124
run: |
121125
echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV
122126
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
123127
- name: Run Python Tests
124128
run: python -m pytest
125129
- name: Run Tests (macOS or Linux)
126-
if: runner.os != 'Windows'
130+
if: "!startsWith(matrix.os, 'windows')"
127131
shell: bash
128132
run: npm test --python="${pythonLocation}/python"
129133
env:
130134
FULL_TEST: ${{ (matrix.node == '20.x' && matrix.python == '3.12') && '1' || '0' }}
131135
- name: Run Tests (Windows)
132-
if: runner.os == 'Windows'
136+
if: startsWith(matrix.os, 'windows')
133137
shell: pwsh
134138
run: npm run test --python="${env:pythonLocation}\\python.exe"
135139
env:

test/test-find-visualstudio.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ class TestVisualStudioFinder extends VisualStudioFinder {
2121
}
2222
}
2323

24+
const shouldSkip = process.platform !== 'win32'
25+
2426
describe('find-visualstudio', function () {
27+
if (shouldSkip) {
28+
return
29+
}
30+
2531
this.beforeAll(function () {
2632
// Condition to skip the test suite
2733
if (process.env.SystemRoot === undefined) {

0 commit comments

Comments
 (0)