Excavator: Migrate Groovy nebula test GcProfileIntegrationSpec to the new Java Junit framework#1946
Open
svc-excavator-bot wants to merge 1 commit intodevelopfrom
Conversation
cf349d0 to
41ebe13
Compare
…he new Java Junit framework
41ebe13 to
07d0184
Compare
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.
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:
opusClaude 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.groovyNew:
gradle-sls-packaging/src/test/java/com/palantir/gradle/dist/service/GcProfileIntegrationTest.javaChanges Made
Delineator comments added to the original Groovy file for review purposes (touchService, signalFile, setup, test method, when/then/cleanup/where blocks, execWithExitCode).
Test migrated from Spock/Groovy to JUnit 5/Java:
@GradlePluginTests+@DisabledConfigurationCacheannotationssetup()→@BeforeEach void setup(RootProject rootProject)cleanup:block →@AfterEach void cleanup(RootProject rootProject)with null-safety guardwhere:data table (GC profiles x Gradle versions) →@ParameterizedTest @MethodSource("gcProfileNames")(Gradle version testing is automatic in the new framework).plugins().add()APIExampleTouchService.javawritten viawriteClass(Files.readString(touchService))execWithExitCode()instance method replaced by existingExecUtils.execWithExitCode().as()descriptionsCompilation verified -
BUILD SUCCESSFULError log written to
test-migration-errors.mddocumenting decisions and confirming no issues found on review passes.Claude Code Metrics
Migration Notes
Test Migration Errors - GcProfileIntegrationSpec
First Pass
No compilation or structural errors encountered during the initial migration.
Decisions Made
ExampleTouchService.java: The original test copies the file using
Files.copy()from a staticPathreference. In the migration, thetouchServicestatic field is preserved, and the content is read viaFiles.readString(touchService)and written using the framework'swriteClass()API. This is idiomatic for the new framework while preserving the original pattern.execWithExitCodemethod: The original test has an instance methodexecWithExitCode(String... tasks)that creates a ProcessBuilder. This is already available asExecUtils.execWithExitCode(RootProject, String...)in the test utilities, so the existing utility is reused.signalFileinstance field: Stored as aPath(instead ofFilein the original) since the new framework usesPaththroughout. Computed in@BeforeEachfromrootProject.path().Cleanup block: The original Spock
cleanup:block unconditionally readsstartup.log(which would throw if the file doesn't exist). The migration adds aFiles.exists()guard in@AfterEachfor robustness.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:
.plugins().add()APIappend()call for build file content.as()descriptions on assertions@GradlePluginTestsand@DisabledConfigurationCacheboth presentTo enable or disable this check, please contact the maintainers of Excavator.