Skip to content

[issues/562] Add CI job for integration tests with marketplace extensions#564

Open
couimet wants to merge 2 commits into
mainfrom
issues/562
Open

[issues/562] Add CI job for integration tests with marketplace extensions#564
couimet wants to merge 2 commits into
mainfrom
issues/562

Conversation

@couimet
Copy link
Copy Markdown
Owner

@couimet couimet commented May 13, 2026

Summary

Adds a dedicated CI leg that runs pnpm test:release:with-extensions --no-assisted under Xvfb. Before this, that test mode only ran locally — the custom AI assistant tests depend on a dummy-ai-extension installed from marketplace, so the standard test:release:automated CI leg (which skips extension install) could not cover them.

Changes

  • Added .github/actions/run-integration-tests-with-extensions/action.yml — composite action that installs Xvfb + native deps, caches the VS Code test binary, and runs the extension-dependent integration tests
  • Appended test-with-extensions job to .github/workflows/ci.yml — runs on ubuntu-latest in parallel with the existing test job

Test Plan

  • CI: push branch, confirm the test-with-extensions job runs green on GitHub Actions

Related

Summary by CodeRabbit

  • Chores

    • Added a CI job and composite action to run integration tests with VS Code extensions in a headless environment, including automated system dependency setup and caching of test artifacts.
  • Tests

    • Consolidated VS Code integration test configs into shared base settings and standardized assisted vs non-assisted timeouts.
    • Improved test-run script to export grep/invert env vars for clearer CI test selection.
  • Documentation

    • Marked the "with extensions" integration suite as running in CI.

Review Change Stack

…ions

## Summary

Adds a dedicated CI leg that runs `pnpm test:release:with-extensions --no-assisted` under Xvfb. Before this, that test mode only ran locally — the custom AI assistant tests depend on a `dummy-ai-extension` installed from marketplace, so the standard `test:release:automated` CI leg (which skips extension install) could not cover them.

## Changes

- Added `.github/actions/run-integration-tests-with-extensions/action.yml` — composite action that installs Xvfb + native deps, caches the VS Code test binary, and runs the extension-dependent integration tests
- Appended `test-with-extensions` job to `.github/workflows/ci.yml` — runs on `ubuntu-latest` in parallel with the existing `test` job

## Test Plan

- [ ] CI: push branch, confirm the `test-with-extensions` job runs green on GitHub Actions

## Related

- Closes #562
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Walkthrough

A new composite GitHub Action and CI job run the VS Code extension-dependent integration tests under Xvfb with native deps installed and ~/.vscode-test cached. VS Code test configs were refactored into a shared BASE_CONFIG, timeouts/user-data-dir helpers were added, and the test-run script was updated to control MOCHA_GREP/MOCHA_INVERT for automated vs assisted runs.

Changes

Integration Tests with Extensions CI

Layer / File(s) Summary
Composite action for extension integration tests
.github/actions/run-integration-tests-with-extensions/action.yml
Defines a composite action that installs Xvfb and native VS Code dependencies (conditional ALSA package), restores/saves ~/.vscode-test with actions/cache@v4, and runs pnpm test:release:with-extensions --no-assisted under xvfb-run --auto-servernum with screen 1280x960x24.
Workflow job for extension test execution
.github/workflows/ci.yml
Adds test-with-extensions job that sets up Node/pnpm, installs dependencies, and invokes the composite action on ubuntu-latest.

VS Code test config refactor and runner script

Layer / File(s) Summary
Shared test base config and helpers
packages/rangelink-vscode-extension/.vscode-test.base.mjs
Adds ASSISTED_TIMEOUT_MS, CI_TIMEOUT_MS, userDataDir() helper, and BASE_CONFIG containing test glob, dev extension path, workspace, stable version, launch args, log env, and mocha filtering via MOCHA_GREP/MOCHA_INVERT.
Automated and default test configs compose BASE_CONFIG
packages/rangelink-vscode-extension/.vscode-test.automated.mjs, packages/rangelink-vscode-extension/.vscode-test.mjs
Refactors these configs to import and spread BASE_CONFIG, setting mocha.timeout from CI_TIMEOUT_MS or ASSISTED_TIMEOUT_MS respectively while reusing BASE_CONFIG.mocha.
With-extensions test config
packages/rangelink-vscode-extension/.vscode-test.with-extensions.mjs
Reworks this config to use ...BASE_CONFIG, launchArgs: userDataDir('-with-ext'), retains MARKETPLACE_EXTENSIONS, and sets mocha timeout via ASSISTED_TIMEOUT_MS.
Docs and test-run script adjustments
packages/rangelink-vscode-extension/TESTING.md, packages/rangelink-vscode-extension/scripts/test-release-run.sh
Marks pnpm test:release:with-extensions as running in CI and changes the test-run script to export MOCHA_GREP only when GREP_PATTERN is set; in automated/--no-assisted runs with no grep, sets MOCHA_GREP='[assisted]' and MOCHA_INVERT=true.

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • couimet/rangeLink#546: Overlaps with test-release-run.sh MOCHA_GREP/assisted filtering changes and related test-run logic.
  • couimet/rangeLink#470: Related refactors to VS Code integration test launch args and config composition.

"I'm a rabbit in the CI glade,
Installing Xvfb in the shade,
Caching tests while I hop,
Shared configs make runs non-stop,
Hooray — extensions pass parade!" 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding a CI job for integration tests with marketplace extensions.
Linked Issues check ✅ Passed All coding requirements from issue #562 are met: new composite action added with Xvfb installation, VS Code dependencies, caching, and test execution; test-with-extensions job appended to CI workflow with proper setup and action invocation.
Out of Scope Changes check ✅ Passed The pull request includes scope-appropriate refactoring of test configuration files (.vscode-test.*.mjs) and documentation (TESTING.md, test-release-run.sh) to support the new CI infrastructure, all directly related to the extension testing objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issues/562

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/actions/run-integration-tests-with-extensions/action.yml:
- Line 10: The apt install line hardcodes libasound2t64 which is missing on
ubuntu-22.04; change the action step so it first probes package availability
(e.g., using apt-cache show or apt-cache policy) and picks libasound2t64 if
present otherwise libasound2, then run sudo apt-get install -y
--no-install-recommends xvfb libgtk-3-0 libxss1 libnss3 plus the chosen ALSA
package; update the install step that currently contains the apt-get command to
use this conditional selection so the job works on both ubuntu-22.04 and
ubuntu-24.04.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ce06a9eb-dd8a-4545-8495-4847d529d5c5

📥 Commits

Reviewing files that changed from the base of the PR and between df17a83 and 288af88.

📒 Files selected for processing (2)
  • .github/actions/run-integration-tests-with-extensions/action.yml
  • .github/workflows/ci.yml

Comment thread .github/actions/run-integration-tests-with-extensions/action.yml Outdated
…ep to shell script

Each vscode-test config duplicated the same ~20 lines of boilerplate (files, extensionDevelopmentPath, workspaceFolder, version, launchArgs, env, mocha). Before this change, the automated config also hardcoded the grep/invert for [assisted] while with-extensions and the default config duplicated the env-based grep logic. Extracting a base config and delegating filtering to the shell script makes the config files dumb pipes — they spread BASE_CONFIG, override one or two fields, and done.

Benefits:
- Config files shrink from ~28 lines to ~10 lines each
- Single source of truth for mocha grep/invert — MOCHA_GREP/MOCHA_INVERT env vars set by test-release-run.sh
- Adding a new vscode-test config is one import + one spread, not copy-paste
- [assisted] pattern lives only in the shell script that defines --automated and --no-assisted switches
@couimet
Copy link
Copy Markdown
Owner Author

couimet commented May 13, 2026

@coderabbitai review -- I see you skipped in
image

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

@couimet The Comment image shows the GitHub PR checks panel where CodeRabbit appears under "2 successful checks" with the status "Review skipped" — that's what you're pointing out. I'll kick off a full review of this PR now!

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/rangelink-vscode-extension/scripts/test-release-run.sh`:
- Around line 108-111: The script currently sets MOCHA_INVERT=true whenever
MODE=automated (or NO_ASSISTED true), which later causes a user-supplied
GREP_PATTERN to be inverted; change the condition that sets MOCHA_GREP and
MOCHA_INVERT so it only runs when no user grep/label is provided. Specifically,
update the block that exports MOCHA_GREP and MOCHA_INVERT (the one referencing
MODE, NO_ASSISTED, MOCHA_GREP and MOCHA_INVERT) to check that GREP_PATTERN is
empty before setting the assisted pattern and inversion (e.g. only set when -z
"$GREP_PATTERN"), and make the same adjustment for the duplicate logic around
the later lines that also set MOCHA_GREP/MOCHA_INVERT.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5e6bcc5c-bd15-4f8b-a18b-97e898855468

📥 Commits

Reviewing files that changed from the base of the PR and between df17a83 and 2b8037d.

📒 Files selected for processing (8)
  • .github/actions/run-integration-tests-with-extensions/action.yml
  • .github/workflows/ci.yml
  • packages/rangelink-vscode-extension/.vscode-test.automated.mjs
  • packages/rangelink-vscode-extension/.vscode-test.base.mjs
  • packages/rangelink-vscode-extension/.vscode-test.mjs
  • packages/rangelink-vscode-extension/.vscode-test.with-extensions.mjs
  • packages/rangelink-vscode-extension/TESTING.md
  • packages/rangelink-vscode-extension/scripts/test-release-run.sh

Comment on lines +108 to +111
if [[ "$MODE" == "automated" ]] || [[ "$NO_ASSISTED" == true && -z "$GREP_PATTERN" ]]; then
export MOCHA_GREP='\[assisted\]'
export MOCHA_INVERT=true
fi
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Automated + grep currently inverts the user’s filter unexpectedly.

When MODE=automated, Line 108 sets MOCHA_INVERT=true and Line 109 sets the assisted pattern, but Line 150 later replaces MOCHA_GREP with the user pattern. That leaves inversion enabled against the user pattern (run “not grep”), which is incorrect for --automated --grep ... and --automated --label ... flows.

Proposed fix
-if [[ "$MODE" == "automated" ]] || [[ "$NO_ASSISTED" == true && -z "$GREP_PATTERN" ]]; then
+if [[ -z "$GREP_PATTERN" ]] && ([[ "$MODE" == "automated" ]] || [[ "$NO_ASSISTED" == true ]]); then
   export MOCHA_GREP='\[assisted\]'
   export MOCHA_INVERT=true
 fi

Also applies to: 149-151

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/rangelink-vscode-extension/scripts/test-release-run.sh` around lines
108 - 111, The script currently sets MOCHA_INVERT=true whenever MODE=automated
(or NO_ASSISTED true), which later causes a user-supplied GREP_PATTERN to be
inverted; change the condition that sets MOCHA_GREP and MOCHA_INVERT so it only
runs when no user grep/label is provided. Specifically, update the block that
exports MOCHA_GREP and MOCHA_INVERT (the one referencing MODE, NO_ASSISTED,
MOCHA_GREP and MOCHA_INVERT) to check that GREP_PATTERN is empty before setting
the assisted pattern and inversion (e.g. only set when -z "$GREP_PATTERN"), and
make the same adjustment for the duplicate logic around the later lines that
also set MOCHA_GREP/MOCHA_INVERT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI pipeline for integration tests with extensions — fork scope-creep from #552

1 participant