diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b8ed54ed..961c6673 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,15 +68,19 @@ jobs: name: semgrep-results path: ./*_results.json vsce-test-windows: - needs: vsce-test runs-on: windows-latest steps: - uses: actions/checkout@v4 - - name: Setup + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install Semgrep + run: python -m pip install semgrep + - name: Setup Node uses: actions/setup-node@v4.0.3 with: node-version: lts/* - - name: install dependencies + - name: install node dependencies run: npm ci # This is needed so download-lspjs.sh can run - name: configure npm @@ -84,15 +88,12 @@ jobs: # windows doesn't like long paths :( - name: Support longpaths run: git config --system core.longpaths true + - name: download osemgrep pro + run: ./download-osemgrep-pro.sh win32-x64 - name: pretest run: npm run pretest - - name: download semgrep results from linux - uses: actions/download-artifact@v4 - with: - name: semgrep-results - path: ./ - - name: run js tests (Windows) - run: npm run test-js + - name: run native tests (Windows) + run: npm run test-native vsce-prepublish: runs-on: ubuntu-latest diff --git a/src/test/runTest.ts b/src/test/runTest.ts index 0062a4f1..d3a66c77 100644 --- a/src/test/runTest.ts +++ b/src/test/runTest.ts @@ -78,6 +78,7 @@ async function main() { ...extensionTestsEnv, CWD: cwd, NODE_ENV: "test", + VSCODE_EXTENSION_DIR: "/nonexistent", // empty or fake folder }; for (const repo of REPOS) { const repoName = repo[0]; @@ -96,7 +97,11 @@ async function main() { extensionDevelopmentPath, extensionTestsPath, extensionTestsEnv, - launchArgs: [repoPath], + launchArgs: [ + repoPath, + // DBG: Disable other extensions + "--disable-extensions", + ], }); } catch (err) { console.error(`Failed to run tests for ${repoName}`); diff --git a/src/test/suite/basic.test.ts b/src/test/suite/basic.test.ts index 2c449766..c99c11e3 100644 --- a/src/test/suite/basic.test.ts +++ b/src/test/suite/basic.test.ts @@ -235,6 +235,9 @@ suite("Extension Features", function () { result.length, "No diagnostics after change", ); + await vscode.commands.executeCommand( + "workbench.action.closeActiveEditor", + ); }).timeout(SCAN_TIMEOUT); }); });