Skip to content

Run unit tests and cover the components - #140

Merged
slachiewicz merged 2 commits into
masterfrom
agent/build-api-tests
Nov 14, 2026
Merged

slachiewicz merged 2 commits into
masterfrom
agent/build-api-tests

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Turns test execution back on and adds JUnit 5 tests for the components, the wire format and the IPC server. ComponentScopeTest fails on any indexed component with more than one scope annotation, which is how #127 shipped. Stacked on #139; retarget to master once that merges.

Not covered: the IPC client, because its port is read once into a static field from a system property.

Verified: mvn verify (Maven 3.9.16, JDK 17) → 42 tests pass; JaCoCo line coverage 441/502 (88%). ComponentScopeTest fails against the DefaultProgress from before #139.

Guice rejects a class carrying both @singleton and @MojoExecutionScoped,
which broke every plugin realm containing the jar. DefaultProgress takes a
MojoExecution, so it is per-execution; do not add @singleton back.

Fixes #127
Surefire had skipTests since the module only shipped test helpers; they are
gone, so tests run again. ComponentScopeTest guards against #127 returning.
@slachiewicz slachiewicz added the build Pull requests that change the build process label Nov 14, 2026
Base automatically changed from agent/default-progress-single-scope to master November 14, 2026 13:10
@slachiewicz
slachiewicz marked this pull request as ready for review November 14, 2026 13:11
@slachiewicz
slachiewicz merged commit d2b6ace into master Nov 14, 2026
13 checks passed
@slachiewicz
slachiewicz deleted the agent/build-api-tests branch November 14, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Pull requests that change the build process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant