Skip to content

Commit

Permalink
GitHub Actions: npm test is failing Windows tests on M1 Macs (#3011)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
cclauss and StefanStojanovic authored Apr 11, 2024
1 parent 77737e4 commit 0bab6a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
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

0 comments on commit 0bab6a0

Please sign in to comment.