-
Notifications
You must be signed in to change notification settings - Fork 0
[issues/562] Add CI job for integration tests with marketplace extensions #564
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
Open
couimet
wants to merge
6
commits into
main
Choose a base branch
from
issues/562
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
288af88
[issues/562] Add CI job for integration tests with marketplace extens…
couimet 2b8037d
[refactor] Extract shared BASE_CONFIG into base.mjs, move assisted gr…
couimet 20bea7e
[PR feedback] Fix MOCHA_INVERT wrongly applied to user-supplied --gre…
couimet e09271e
[fix] Populate with-ext user data dir for custom AI tests in CI
couimet 213b9bc
Ran `pnpm fix`
couimet 1688cea
[PR feedback] Validate --suffix arg, replace subshell with single [[ …
couimet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
.github/actions/run-integration-tests-with-extensions/action.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: 'Run Integration Tests (with extensions)' | ||
| description: 'Run pnpm test:release:with-extensions --no-assisted under Xvfb — installs marketplace extensions and runs automated tests that depend on them' | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Install Xvfb and VS Code native dependencies | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get update | ||
| ALSA_PKG=$(apt-cache show libasound2t64 >/dev/null 2>&1 && echo libasound2t64 || echo libasound2) | ||
| sudo apt-get install -y --no-install-recommends xvfb libgtk-3-0 libxss1 libnss3 "$ALSA_PKG" | ||
|
|
||
| - name: Cache VS Code test binary | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.vscode-test | ||
| key: vscode-test-${{ runner.os }}-stable | ||
| restore-keys: vscode-test-${{ runner.os }}- | ||
|
|
||
| - name: Run integration tests under Xvfb | ||
| shell: bash | ||
| run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" pnpm test:release:with-extensions --no-assisted |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 3 additions & 19 deletions
22
packages/rangelink-vscode-extension/.vscode-test.automated.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,10 @@ | ||
| import * as os from 'node:os'; | ||
| import * as path from 'node:path'; | ||
|
|
||
| import { defineConfig } from '@vscode/test-cli'; | ||
|
|
||
| const MOCHA_TIMEOUT_MS = 20_000; | ||
| const ASSISTED_TEST_GREP = '\\[assisted\\]'; | ||
| const USER_DATA_DIR = path.join(os.tmpdir(), 'rl-vscode-test'); | ||
| import { CI_TIMEOUT_MS, BASE_CONFIG } from './.vscode-test.base.mjs'; | ||
|
|
||
| export default defineConfig([ | ||
| { | ||
| files: 'out/__integration-tests__/suite/**/*.test.js', | ||
| extensionDevelopmentPath: ['./', './test-fixtures/dummy-ai-extension/'], | ||
| workspaceFolder: './', | ||
| version: 'stable', | ||
| launchArgs: ['--user-data-dir', USER_DATA_DIR], | ||
| env: { | ||
| RANGELINK_CAPTURE_LOGS: 'true', | ||
| }, | ||
| mocha: { | ||
| timeout: MOCHA_TIMEOUT_MS, | ||
| grep: ASSISTED_TEST_GREP, | ||
| invert: true, | ||
| }, | ||
| ...BASE_CONFIG, | ||
| mocha: { timeout: CI_TIMEOUT_MS, ...BASE_CONFIG.mocha }, | ||
| }, | ||
| ]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import * as os from 'node:os'; | ||
| import * as path from 'node:path'; | ||
|
|
||
| // 10 minutes per test — assisted tests block on human interaction. | ||
| export const ASSISTED_TIMEOUT_MS = 600_000; | ||
|
|
||
| // No human in CI — automated tests resolve in under 5s. | ||
| export const CI_TIMEOUT_MS = 20_000; | ||
|
|
||
| export const userDataDir = (suffix = '') => [ | ||
| '--user-data-dir', | ||
| path.join(os.tmpdir(), `rl-vscode-test${suffix}`), | ||
| ]; | ||
|
|
||
| // grep and invert are driven by env vars set in test-release-run.sh. | ||
| const envMocha = () => ({ | ||
| ...(process.env.MOCHA_GREP ? { grep: process.env.MOCHA_GREP } : {}), | ||
| ...(process.env.MOCHA_INVERT === 'true' ? { invert: true } : {}), | ||
| }); | ||
|
|
||
| export const BASE_CONFIG = { | ||
| files: 'out/__integration-tests__/suite/**/*.test.js', | ||
| extensionDevelopmentPath: ['./', './test-fixtures/dummy-ai-extension/'], | ||
| workspaceFolder: './', | ||
| version: 'stable', | ||
| launchArgs: userDataDir(), | ||
| env: { RANGELINK_CAPTURE_LOGS: 'true' }, | ||
| mocha: envMocha(), | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,10 @@ | ||
| import * as os from 'node:os'; | ||
| import * as path from 'node:path'; | ||
|
|
||
| import { defineConfig } from '@vscode/test-cli'; | ||
|
|
||
| // 10 minutes per test — assisted tests block on human interaction (modal | ||
| // verdict dialogs don't auto-dismiss), so the human needs headroom to read | ||
| // instructions, complete UI actions, or step away for a break. Automated tests | ||
| // never come close to this threshold. | ||
| const MOCHA_TIMEOUT_MS = 600_000; | ||
| const USER_DATA_DIR = path.join(os.tmpdir(), 'rl-vscode-test'); | ||
| import { ASSISTED_TIMEOUT_MS, BASE_CONFIG } from './.vscode-test.base.mjs'; | ||
|
|
||
| export default defineConfig([ | ||
| { | ||
| files: 'out/__integration-tests__/suite/**/*.test.js', | ||
| extensionDevelopmentPath: ['./', './test-fixtures/dummy-ai-extension/'], | ||
| workspaceFolder: './', | ||
| version: 'stable', | ||
| launchArgs: ['--user-data-dir', USER_DATA_DIR], | ||
| env: { | ||
| RANGELINK_CAPTURE_LOGS: 'true', | ||
| }, | ||
| mocha: { | ||
| timeout: MOCHA_TIMEOUT_MS, | ||
| ...(process.env.MOCHA_GREP ? { grep: process.env.MOCHA_GREP } : {}), | ||
| }, | ||
| ...BASE_CONFIG, | ||
| mocha: { timeout: ASSISTED_TIMEOUT_MS, ...BASE_CONFIG.mocha }, | ||
| }, | ||
| ]); |
28 changes: 7 additions & 21 deletions
28
packages/rangelink-vscode-extension/.vscode-test.with-extensions.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,17 @@ | ||
| import * as os from 'node:os'; | ||
| import * as path from 'node:path'; | ||
|
|
||
| import { defineConfig } from '@vscode/test-cli'; | ||
|
|
||
| // Same timeout as the main config — assisted tests block on human interaction. | ||
| const MOCHA_TIMEOUT_MS = 600_000; | ||
| const USER_DATA_DIR = path.join(os.tmpdir(), 'rl-vscode-test-with-ext'); | ||
| import { ASSISTED_TIMEOUT_MS, BASE_CONFIG, userDataDir } from './.vscode-test.base.mjs'; | ||
|
|
||
| // Extensions installed from the marketplace before tests run. | ||
| // With these present, isClaudeCodeAvailable() returns true, enabling [assisted] | ||
| // tests that verify real focus + paste behavior. | ||
| // Marketplace extensions installed before tests run. With these present, | ||
| // isClaudeCodeAvailable() returns true, enabling tests that verify real | ||
| // focus + paste behavior. | ||
| const MARKETPLACE_EXTENSIONS = ['anthropic.claude-code']; | ||
|
|
||
| export default defineConfig([ | ||
| { | ||
| files: 'out/__integration-tests__/suite/**/*.test.js', | ||
| extensionDevelopmentPath: ['./', './test-fixtures/dummy-ai-extension/'], | ||
| workspaceFolder: './', | ||
| version: 'stable', | ||
| ...BASE_CONFIG, | ||
| launchArgs: userDataDir('-with-ext'), | ||
| installExtensions: MARKETPLACE_EXTENSIONS, | ||
| launchArgs: ['--user-data-dir', USER_DATA_DIR], | ||
| env: { | ||
| RANGELINK_CAPTURE_LOGS: 'true', | ||
| }, | ||
| mocha: { | ||
| timeout: MOCHA_TIMEOUT_MS, | ||
| ...(process.env.MOCHA_GREP ? { grep: process.env.MOCHA_GREP } : {}), | ||
| }, | ||
| mocha: { timeout: ASSISTED_TIMEOUT_MS, ...BASE_CONFIG.mocha }, | ||
| }, | ||
| ]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote
$VSCODE_TEST_CONFIGto prevent word splitting.The variable should be quoted to avoid potential issues if it contains special characters or spaces, following shell scripting best practices.
🐚 Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 Shellcheck (0.11.0)
[info] 156-156: Double quote to prevent globbing and word splitting.
(SC2086)
🤖 Prompt for AI Agents