Skip to content

ci: eliminate redundant compile pass in test:coverage script#179

Merged
askpt merged 1 commit intomainfrom
ci-coach/optimize-test-coverage-script-fcc9681149f8db79
Mar 3, 2026
Merged

ci: eliminate redundant compile pass in test:coverage script#179
askpt merged 1 commit intomainfrom
ci-coach/optimize-test-coverage-script-fcc9681149f8db79

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 3, 2026

Summary

Removes a redundant TypeScript compilation + ESLint pass from the test:coverage script, which runs on every Linux CI job. This reduces unnecessary work without changing test behavior.

Optimizations

1. Eliminate Double Compilation in test:coverage

Type: Resource / Efficiency
Impact: Saves ~3–8 seconds per Linux CI run (one tsc + one eslint src execution removed)
Risk: Low

Root Cause:

The previous test:coverage script chained two commands that each triggered compilation:

test:unit  →  npm run compile  (compile #1)  →  mocha
npm test   →  pretest: compile (compile #2) + lint  →  vscode-test

Changes:

Before:

"test:coverage": "npm run test:unit && npm test"

After:

"test:coverage": "npm run compile && npm run lint && c8 --config .c8rc.json mocha out/unit/unit.test.js && vscode-test"

The flattened script runs the full pipeline once: compile → lint → c8 mocha → vscode-test. The vscode-test binary is called directly (bypassing the pretest hook) since compilation and linting have already run.

Rationale: npm test always triggers the pretest lifecycle hook (compile && lint). Chaining test:unit (which also compiles) and then npm test caused tsc and eslint to each run twice. The flattened script produces identical results with one fewer compile+lint cycle.

Detailed Analysis

Previous execution path for npm run test:coverage on Linux CI:

  1. npm run test:unitnpm run compile (compile chore(main): release 0.1.0 #1) → c8 mocha out/unit/unit.test.js
  2. npm testpretest (compile ci: remove redundant pull request branch specification #2 + lint chore(main): release 0.1.0 #1) → vscode-test

New execution path:

  1. npm run compile (compile chore(main): release 0.1.0 #1)
  2. npm run lint (lint chore(main): release 0.1.0 #1)
  3. c8 --config .c8rc.json mocha out/unit/unit.test.js
  4. vscode-test

The test:unit script is unchanged and still self-contained with its own compile step for standalone use. Only the test:coverage aggregation script is updated.

Expected Impact

  • Time Savings: ~3–8 seconds per Linux CI run
  • Risk Level: Low — same compile output, same tests, same coverage collection
  • Standalone npm run test:unit: Unaffected, still self-contained

Testing Recommendations

  • Review workflow syntax
  • Confirm vscode-test binary resolves correctly in node_modules/.bin
  • Monitor first few runs after merge to verify coverage report is identical

Generated by CI Optimization Coach

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/ci-coach.md@442992eda2ccb11ee75a39c019ec6d38ae5a84a2
  • expires on Mar 5, 2026, 1:15 PM UTC

The test:coverage script previously chained test:unit (which runs compile)
and npm test (which runs pretest: compile + lint), causing TypeScript to
compile twice and ESLint to run twice on every Linux CI coverage run.

Flattened the script to: compile -> lint -> c8 mocha -> vscode-test
This removes one full tsc + eslint execution from every Linux CI run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@askpt askpt changed the title [ci-coach] perf: eliminate redundant compile pass in test:coverage script perf: eliminate redundant compile pass in test:coverage script Mar 3, 2026
@askpt askpt marked this pull request as ready for review March 3, 2026 14:37
@askpt askpt self-requested a review as a code owner March 3, 2026 14:37
Copilot AI review requested due to automatic review settings March 3, 2026 14:37
@askpt askpt changed the title perf: eliminate redundant compile pass in test:coverage script ci: eliminate redundant compile pass in test:coverage script Mar 3, 2026
@askpt askpt closed this Mar 3, 2026
@askpt askpt reopened this Mar 3, 2026
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.17%. Comparing base (6a1a90c) to head (8147238).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #179   +/-   ##
=======================================
  Coverage   59.17%   59.17%           
=======================================
  Files           6        6           
  Lines        1984     1984           
  Branches      143      143           
=======================================
  Hits         1174     1174           
  Misses        810      810           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes the VS Code extension’s CI test pipeline by removing redundant TypeScript compilation and ESLint passes from the Linux test:coverage run, reducing CI time without changing the set of tests executed.

Changes:

  • Replaces test:coverage’s chained test:unit && npm test with a flattened pipeline (compile → lint → c8+mocha → vscode-test) to avoid duplicate compile/lint execution.

@askpt askpt merged commit 8eafd5a into main Mar 3, 2026
32 checks passed
@askpt askpt deleted the ci-coach/optimize-test-coverage-script-fcc9681149f8db79 branch March 3, 2026 14:40
github-actions bot pushed a commit that referenced this pull request Mar 3, 2026
…ompile)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants