Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the AVA test configuration to allow parallel test execution, while explicitly marking tests that rely on shared mutable state (notably process.env) as sequential to preserve correctness.
Changes:
- Remove the global
--serialflag from theavanpm script to enable parallel test runs. - Convert many unit tests to
test.serial(...)where they mutate environment variables or other shared state. - Regenerate corresponding compiled
lib/*JavaScript artifacts to reflectpackage.jsonchanges.
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/workflow.test.ts | Marks env-dependent workflow validation tests as serial. |
| src/util.test.ts | Marks env-mutating util tests as serial (extra options, env var helpers, etc.). |
| src/upload-sarif.test.ts | Marks SARIF upload macro tests and tmp-dir tests as serial. |
| src/trap-caching.test.ts | Marks cache-related tests that touch env/event files as serial. |
| src/status-report.test.ts | Marks status-report tests as serial to avoid env interference. |
| src/start-proxy/environment.test.ts | Marks proxy environment tests as serial due to env mutations. |
| src/start-proxy.test.ts | Marks start-proxy tests as serial (credentials/env/error-message behavior). |
| src/setup-codeql.test.ts | Marks setup-codeql tests as serial (platform/env/toolcache stubbing). |
| src/overlay/status.test.ts | Marks overlay cache status tests as serial (RUNNER_TEMP/cache stubbing). |
| src/overlay/index.test.ts | Marks overlay change-file/cache-key tests as serial. |
| src/init.test.ts | Marks tests that rely on shared env/stubs as serial. |
| src/init-action-post-helper.test.ts | Marks init-post tests as serial (env-driven execution paths). |
| src/git-utils.test.ts | Marks git-utils tests as serial (env + global stubbing of git helpers). |
| src/feature-flags/properties.test.ts | Marks repository properties feature-flag tests as serial. |
| src/feature-flags.test.ts | Marks feature flag tests as serial to avoid shared env/cache interference. |
| src/diff-informed-analysis-utils.test.ts | Marks diff-informed analysis tests as serial. |
| src/dependency-caching.test.ts | Marks dependency-caching tests as serial where env/stubs are involved. |
| src/database-upload.test.ts | Marks database upload tests as serial (env + HTTP mocking). |
| src/cli-errors.test.ts | Marks platform/arch stubbing tests as serial. |
| src/api-client.test.ts | Marks API-client tests as serial. |
| src/analyze.test.ts | Marks analyze status report test as serial. |
| src/analyses.test.ts | Marks analysis-kinds and risk assessment tests as serial. |
| src/actions-util.test.ts | Marks some actions-util tests as serial; further serialisation may be needed for github.context mutation. |
| package.json | Removes ava --serial to allow parallel execution. |
| lib/upload-sarif-action.js | Compiled output update (generated from TS / package changes). |
| lib/upload-sarif-action-post.js | Compiled output update (generated). |
| lib/upload-lib.js | Compiled output update (generated). |
| lib/start-proxy-action.js | Compiled output update (generated). |
| lib/start-proxy-action-post.js | Compiled output update (generated). |
| lib/setup-codeql-action.js | Compiled output update (generated). |
| lib/resolve-environment-action.js | Compiled output update (generated). |
| lib/init-action.js | Compiled output update (generated). |
| lib/init-action-post.js | Compiled output update (generated). |
| lib/autobuild-action.js | Compiled output update (generated). |
| lib/analyze-action.js | Compiled output update (generated). |
| lib/analyze-action-post.js | Compiled output update (generated). |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Drop the
--serialflag we pass to ava in favour of specifying which tests need to be run sequentially. These are typically ones which read and write environment variables. This speeds up the unit tests by 4x on my machine from ~24s to ~6s (measured fairly unscientifically by comparing 5 runs of each).