Skip to content

chore: Add extension host test GitHub Action annotations - #345

Draft
X-Guardian wants to merge 1 commit into
eFAILution:mainfrom
X-Guardian:feature/extension-host-test-annotations
Draft

X-Guardian wants to merge 1 commit into
eFAILution:mainfrom
X-Guardian:feature/extension-host-test-annotations

Conversation

@X-Guardian

Copy link
Copy Markdown
Contributor

Summary

  • On GitHub Actions, extension-host test failures are now reported as error annotations on the TypeScript line that failed, and a pass/fail count is added to the job summary.
  • The test runner uses Mocha's built-in github-actions reporter when GITHUB_ACTIONS is set. That is the spec reporter plus the annotations and job summary, and it needs no new dependency. Elsewhere it keeps the spec reporter.
  • The reporter places an annotation from the failure's stack. The extension host formats stacks itself and ignores source maps, so the stack names the compiled files in out-test, which are not in the repository. The runner now rewrites those frames to their tests/extension-host/**/*.ts lines through the .js.map files, using Node's module.SourceMap, before the reporter reads them. Failure stacks in the spec output name the .ts lines too, locally as well as in CI.
  • No workflow change is needed: Actions sets GITHUB_ACTIONS and GITHUB_STEP_SUMMARY, and both reach the extension host through npm run test:extension-host.

Change Type

  • feat
  • fix
  • refactor
  • docs
  • test
  • chore

Context

User-facing impact

  • None. Only the test runner changes.

GitLab scope

  • gitlab.com
  • self-managed GitLab
  • both

Affected areas

  • Component Browser
  • Hover provider
  • Completion provider
  • Validation provider
  • Cache and refresh behavior
  • GitLab API calls/auth/token storage
  • Docs only

Validation

Local checks

  • npm run compile
  • npm test or targeted tests
  • Manual verification in VS Code Extension Host

Manual test notes

  • Added a temporary test asserting 1 === 2 and ran npm run test:extension-host with GITHUB_ACTIONS=true and GITHUB_STEP_SUMMARY set. All 22 real tests passed. The reporter printed ::error file=tests/extension-host/suite/zzAnnotation.test.ts,line=5,col=12::Expected values to be strictly equal…, which is the assertion's line, and wrote 22 passing and 1 failing to the summary file.
  • Without GITHUB_ACTIONS, the output is the spec reporter's with no ::error lines, and the failure's stack names zzAnnotation.test.ts:5:12.
  • The temporary test was removed.

Breaking Changes

  • No breaking changes
  • Breaking changes (describe below)

Risk and Rollback

  • Main risks: low. If a frame has no source mapping, it is left as it is, and the annotation falls back to the compiled file.
  • Rollback strategy: revert the commit.

Release Notes Draft

  • None (test tooling only).

Checklist

  • Branch is up to date with target branch
  • Commit messages follow conventional commits
  • Added/updated docs for behavior or settings changes
  • Added/updated tests for new behavior
  • No secrets or tokens in code, logs, screenshots, or test fixtures

This branch has not been deployed

No deployments
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.

1 participant