Skip to content

Add direct setup orchestration tests - #1163

Merged
brunoborges merged 1 commit into
mainfrom
brunoborges-test-setup-orchestration
Jul 29, 2026
Merged

Add direct setup orchestration tests#1163
brunoborges merged 1 commit into
mainfrom
brunoborges-test-setup-orchestration

Conversation

@brunoborges

Copy link
Copy Markdown
Contributor

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:

  • Ran npm run check locally (format, lint, build, test) and all checks pass.
  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

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
Copilot AI review requested due to automatic review settings July 29, 2026 04:30
@brunoborges
brunoborges requested a review from a team as a code owner July 29, 2026 04:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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() from src/setup-java.ts and 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/setup bundle 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

Comment thread src/setup-java.ts
@brunoborges
brunoborges merged commit 6e26972 into main Jul 29, 2026
444 checks passed
@brunoborges
brunoborges deleted the brunoborges-test-setup-orchestration branch July 29, 2026 04:36
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.

Add direct tests for setup action orchestration

2 participants