Skip to content
Draft
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
21 changes: 11 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,32 @@ 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
run: npm config set script-shell "C:\\Program Files\\Git\\Bin\\bash.exe"
# 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
Expand Down
7 changes: 6 additions & 1 deletion src/test/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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}`);
Expand Down
3 changes: 3 additions & 0 deletions src/test/suite/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ suite("Extension Features", function () {
result.length,
"No diagnostics after change",
);
await vscode.commands.executeCommand(
"workbench.action.closeActiveEditor",
);
}).timeout(SCAN_TIMEOUT);
});
});
Loading