esword/migrate_BaselineFormatIntegrationTest #3372
Open
+7,722
−286
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.
A formatted diff between the old and new test has been generated at test-migration-notes/BaselineFormatIntegrationTest.html)
To view the rendered diff, click here.
🤖 🤖 This PR was created using Claude-code 🤖 🤖
Claude Execution Message
Claude finished running successfully.
Perfect! The migration is complete. Let me provide a summary of what was accomplished:
Migration Summary
I've successfully migrated the
BaselineFormatIntegrationTestfrom the Nebula/Groovy framework to the new Java-based testing framework. Here's what was done:Key Changes Made:
Migration Details:
Framework Changes:
@Unroll+where:to@GradlePluginTestswith automatic multi-version testingbuildFile <<with fluent API methods like.buildGradle().append()API Migrations:
with('task').build()→gradle.withArgs('task').buildsSuccessfully()file('path') << content→rootProject.file('path').overwrite(content)GradleFileobjectsassertThat(path).hasSameTextualContentAs()→ Using AssertJ directly for path assertions.assertThat().hasContent()on file objectsKey Learnings:
.path()methods that returnPathobjects.assertThat()method for AssertJ assertions.plugins().add()instead ofapply plugin:)Files Created/Modified:
gradle-baseline-java/src/test/groovy/com/palantir/baseline/BaselineFormatIntegrationTest.groovy- Added delineator commentsgradle-baseline-java/src/test/java/com/palantir/baseline/BaselineFormatIntegrationTest.java- New migrated testtest-migration-errors.md- Documentation of issues encountered and fixes appliedThe test compiles successfully and is ready for use!
Claude Code Metrics
Migration Notes
Test Migration Errors
First Compilation Attempt
Error 1:
toFile()method not found on Directorydirectory().toFile()which doesn't exist on theDirectoryinterfacedirectory().path().toFile()instead. TheDirectoryinterface has apath()method that returns aPath, andPathhastoFile()Error 2:
toFile()method not found on RootProjectrootProject.toFile()which doesn't existrootProject.path().toFile()instead.RootProjectis arecordwith apath()methodError 3:
assertThat(Path).hasSameTextualContentAs()not availablehasSameTextualContentAs()which requires importing AssertJ assertions directly, not the framework's assertionsAssertions.assertThat(path).hasSameTextualContentAs(expectedFile)Error 4:
assertThat(ArbitraryFile).hasContent()not foundassertThat(rootProject.file(...)).hasContent()but the framework'sassertThatonly supportsTaskOutcomeandInvocationResultrootProject.file(...).assertThat().hasContent()- the file object itself has anassertThat()method that returns AssertJ path assertionsSecond Compilation Attempt
Error 5: ErrorProne check flagging
apply plugin:in appendGradleTestPluginsBlockflags any use ofapply plugin:in appended content.plugins().add("groovy")instead of appendingapply plugin: 'groovy'Final Review Pass
Changes Made
Things That Were Correct
.assertThat().hasContent()for file content assertionsLearnings
assertThat()methodspath()methods that returnPathobjects.plugins().add()instead ofapply plugin: