-
Notifications
You must be signed in to change notification settings - Fork 276
[Chore] Reduce Windows CI cold-start time #1654
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
Draft
zoomote
wants to merge
2
commits into
main
Choose a base branch
from
chore/windows-ci-cold-start-1wm745f9qjla3
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.
+185
−7
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import assert from "node:assert/strict" | ||
| import fs from "node:fs" | ||
| import path from "node:path" | ||
| import { describe, it } from "node:test" | ||
| import { fileURLToPath } from "node:url" | ||
|
|
||
| const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..") | ||
| const workflow = fs.readFileSync(path.join(repositoryRoot, ".github/workflows/code-qa.yml"), "utf8") | ||
| const extensionTurbo = JSON.parse(fs.readFileSync(path.join(repositoryRoot, "src/turbo.json"), "utf8")) | ||
|
|
||
| const workflowStep = (name) => { | ||
| const match = workflow.match(new RegExp(`- name: ${name}\\n(?<body>(?:\\s{14,}.*\\n?)*)`)) | ||
| assert.ok(match?.groups?.body, `missing workflow step: ${name}`) | ||
| return match.groups.body | ||
| } | ||
|
|
||
| describe("platform unit-test workflow", () => { | ||
| it("keeps coverage authoritative on Ubuntu and runs equivalent uninstrumented Windows tests", () => { | ||
| assert.match(workflow, /name: ubuntu-latest[\s\S]*?collect-coverage: true/) | ||
| assert.match(workflow, /name: windows-latest[\s\S]*?collect-coverage: false/) | ||
| assert.ok(!workflow.includes("matrix.upload-coverage")) | ||
|
|
||
| const extensionCoverage = workflowStep("Run extension coverage lanes") | ||
| assert.match(extensionCoverage, /if: matrix\.collect-coverage/) | ||
| assert.ok(extensionCoverage.includes("test:coverage:api test:coverage:core")) | ||
|
|
||
| const extensionTests = workflowStep("Run extension test lanes") | ||
| assert.match(extensionTests, /if: \$\{\{ !matrix\.collect-coverage \}\}/) | ||
| assert.ok(extensionTests.includes("test:api test:core test:services test:misc test:tree-sitter")) | ||
|
|
||
| for (const [stepName, command] of [ | ||
| ["Run non-extension package coverage", 'test:coverage --filter="!@roo-code/core" --filter="!zoo-code"'], | ||
| ["Run core unit coverage", 'test:coverage:unit --filter="@roo-code/core"'], | ||
| ["Run core integration coverage", 'test:coverage:integration --filter="@roo-code/core"'], | ||
| ]) { | ||
| const body = workflowStep(stepName) | ||
| assert.ok(!body.includes("if:"), `${stepName} must retain its cache-compatible task on both platforms`) | ||
| assert.ok(body.includes(command), `missing command in step: ${stepName}`) | ||
| } | ||
| }) | ||
|
|
||
| it("does not run coverage verification or uploads on Windows", () => { | ||
| for (const stepName of [ | ||
| "Verify extension coverage contract", | ||
| "Verify extension coverage reports", | ||
| "Merge extension coverage reports", | ||
| "Verify coverage cache inputs", | ||
| "Upload non-core coverage to Codecov", | ||
| "Upload webview JSDOM coverage to Codecov", | ||
| "Upload core unit coverage to Codecov", | ||
| "Upload core integration coverage to Codecov", | ||
| "Upload coverage reports to GitHub", | ||
| ]) { | ||
| assert.match(workflowStep(stepName), /if: matrix\.collect-coverage/) | ||
| } | ||
| }) | ||
|
|
||
| it("keeps plain extension lanes aligned with coverage cache boundaries", () => { | ||
| for (const lane of ["api", "core", "services", "misc", "tree-sitter"]) { | ||
| const plainTask = extensionTurbo.tasks[`test:${lane}`] | ||
| const coverageTask = extensionTurbo.tasks[`test:coverage:${lane}`] | ||
|
|
||
| assert.deepEqual(plainTask.dependsOn, coverageTask.dependsOn) | ||
| assert.deepEqual(plainTask.inputs, coverageTask.inputs) | ||
| } | ||
| }) | ||
| }) | ||
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: Zoo-Code-Org/Zoo-Code
Length of output: 6437
🏁 Script executed:
Repository: Zoo-Code-Org/Zoo-Code
Length of output: 4526
Parse workflow steps before asserting their guards.
workflowStepcaptures raw indented YAML text, and the assertions forRun extension coverage lanesandRun extension test lanessearch that text withassert.matchandincludes. A comment or nested value can preserve the expected condition string after the step-leveliffield is removed or changed. The test can then miss Windows coverage running withcollect-coverage: falseor the plain lane using the wrong condition. Parse each step and assert itsrunandiffields together.🤖 Prompt for AI Agents