Skip to content

Excavator: Migrate Groovy nebula test GcProfileIntegrationSpec to the new Java Junit framework#1946

Open
svc-excavator-bot wants to merge 1 commit intodevelopfrom
roomba/migrate-gradle-testing-junit-framework-e55595b0f5880fc5
Open

Excavator: Migrate Groovy nebula test GcProfileIntegrationSpec to the new Java Junit framework#1946
svc-excavator-bot wants to merge 1 commit intodevelopfrom
roomba/migrate-gradle-testing-junit-framework-e55595b0f5880fc5

Conversation

@svc-excavator-bot
Copy link
Copy Markdown
Collaborator

@svc-excavator-bot svc-excavator-bot commented Jan 1, 2026

excavator is a bot for automating changes across repositories.

Changes produced by the roomba/migrate-gradle-testing-junit-framework check.

A formatted diff between the old and new test has been generated at test-migration-notes/GcProfileIntegrationSpec.html)
To view the rendered diff, copy the branch name above, click here, and then replace the BRANCH_NAME part of the URL with the branch name.

🤖 🤖 This PR was created using Claude-code 🤖 🤖

Model: opus


Claude Execution Message

Claude finished running successfully.

All tasks are complete. Here's a summary of what was done:

Migration Summary

Original: gradle-sls-packaging/src/test/groovy/com/palantir/gradle/dist/service/GcProfileIntegrationSpec.groovy
New: gradle-sls-packaging/src/test/java/com/palantir/gradle/dist/service/GcProfileIntegrationTest.java

Changes Made

  1. Delineator comments added to the original Groovy file for review purposes (touchService, signalFile, setup, test method, when/then/cleanup/where blocks, execWithExitCode).

  2. Test migrated from Spock/Groovy to JUnit 5/Java:

    • @GradlePluginTests + @DisabledConfigurationCache annotations
    • setup()@BeforeEach void setup(RootProject rootProject)
    • cleanup: block → @AfterEach void cleanup(RootProject rootProject) with null-safety guard
    • Spock where: data table (GC profiles x Gradle versions) → @ParameterizedTest @MethodSource("gcProfileNames") (Gradle version testing is automatic in the new framework)
    • Plugin applied via .plugins().add() API
    • ExampleTouchService.java written via writeClass(Files.readString(touchService))
    • execWithExitCode() instance method replaced by existing ExecUtils.execWithExitCode()
    • Assertions use AssertJ with .as() descriptions
  3. Compilation verified - BUILD SUCCESSFUL

  4. Error log written to test-migration-errors.md documenting decisions and confirming no issues found on review passes.

Claude Code Metrics

Metric Value
Total cost $1.4400020999999998
Total Duration (API) 442776 ms
Total Duration (WALL) 437339 ms
Token usage 5110 (input), 23068 (output)
Cached tokens 56014 (creation), 711427 (read)

Migration Notes

Test Migration Errors - GcProfileIntegrationSpec

First Pass

No compilation or structural errors encountered during the initial migration.

Decisions Made

  1. ExampleTouchService.java: The original test copies the file using Files.copy() from a static Path reference. In the migration, the touchService static field is preserved, and the content is read via Files.readString(touchService) and written using the framework's writeClass() API. This is idiomatic for the new framework while preserving the original pattern.

  2. execWithExitCode method: The original test has an instance method execWithExitCode(String... tasks) that creates a ProcessBuilder. This is already available as ExecUtils.execWithExitCode(RootProject, String...) in the test utilities, so the existing utility is reused.

  3. signalFile instance field: Stored as a Path (instead of File in the original) since the new framework uses Path throughout. Computed in @BeforeEach from rootProject.path().

  4. Cleanup block: The original Spock cleanup: block unconditionally reads startup.log (which would throw if the file doesn't exist). The migration adds a Files.exists() guard in @AfterEach for robustness.

  5. Parameterization: The original test was parameterized over both GC profiles and Gradle versions using Spock where: blocks. In the new framework, Gradle version testing is automatic, so only the GC profile names are parameterized via @MethodSource.

Second Pass (Review against testing guide)

No additional changes needed. All best practices verified:

  • Plugin application uses .plugins().add() API
  • Text blocks with no leading newlines
  • Single append() call for build file content
  • .as() descriptions on assertions
  • Parameterized test parameters ordered correctly (data params before injected params)
  • No unused parameters in method signatures
  • @GradlePluginTests and @DisabledConfigurationCache both present

To enable or disable this check, please contact the maintainers of Excavator.

@svc-excavator-bot svc-excavator-bot force-pushed the roomba/migrate-gradle-testing-junit-framework-e55595b0f5880fc5 branch from cf349d0 to 41ebe13 Compare February 1, 2026 05:31
@svc-excavator-bot svc-excavator-bot force-pushed the roomba/migrate-gradle-testing-junit-framework-e55595b0f5880fc5 branch from 41ebe13 to 07d0184 Compare March 1, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant