Add direct setup orchestration tests - #1163
Merged
Merged
Conversation
Make the setup entrypoint import-safe and cover its validation, installation sequencing, post-install collaborators, caching, and failure handling directly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a5ba8975-a9ac-4d2c-b41d-97c99689d1bd
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors the setup action entrypoint to be testable without executing on module import, and adds a focused orchestration unit test suite to prevent regressions in input parsing and collaborator sequencing.
Changes:
- Export
run()fromsrc/setup-java.tsand guard execution with an ESM entrypoint check (matching the cleanup action pattern). - Add a new mocked orchestration test suite covering validation, version-file inference, multi-JDK ordering, toolchains, post-install sequencing, caching, and failure handling.
- Regenerate the checked-in
dist/setupbundle to reflect the updated entrypoint behavior.
Show a summary per file
| File | Description |
|---|---|
src/setup-java.ts |
Exports run() and conditionally executes it only when invoked as the entrypoint. |
dist/setup/index.js |
Updates the bundled runtime to match the new exported/guarded entrypoint behavior. |
__tests__/setup-java.test.ts |
Adds direct unit tests for setup orchestration using mocked collaborators and inputs. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/3 changed files
- Comments generated: 1
- Review effort level: Low
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.
Description:
The setup action entrypoint previously executed on import, preventing focused tests of its orchestration. This exports
run()and guards execution with the same ESM entrypoint check used by the cleanup action, then adds mocked unit coverage for input validation, version-file inference, JDK and Maven toolchain ordering, post-install sequencing, caching, and failure handling.The checked-in setup bundle is regenerated so runtime behavior matches the source.
Related issue:
Fixes: #1158
Check list:
npm run checklocally (format, lint, build, test) and all checks pass.