Excavator: Migrate Groovy nebula test ConjureLocalPluginTest to the new Java Junit framework#1888
Open
svc-excavator-bot wants to merge 1 commit intodevelopfrom
Conversation
… new Java Junit framework
061f9f2 to
84009a4
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/ConjureLocalPluginTest.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.
Migration complete. Here's a summary of what was done:
Files modified:
gradle-conjure/src/test/groovy/com/palantir/gradle/conjure/ConjureLocalPluginTest.groovy- Added***DELINEATOR FOR REVIEWcomments before each method and Spock keywords (when:,then:,expect:)Files created:
gradle-conjure/src/test/java/com/palantir/gradle/conjure/ConjureLocalPluginTest.java- Migrated test with all 5 test methodsgradle-conjure/src/test/java/com/palantir/gradle/conjure/TestVersions.java- Moved from groovy directory so Java tests can reference ittest-migration-errors.md- Documents errors encountered and fixes appliedKey migration decisions:
apply plugin: 'com.palantir.conjure-local'replaced with.plugins().add("com.palantir.conjure-local")GradleFile, usingappend()with format parameters for version interpolationrootProject.subproject("name")for tests that don't reference the SubProject variable (to avoid Error Prone'sStrictUnusedVariablecheck); usedSubProjectparameter injection for tests that do use itassertThat()calls with.as()descriptions for file and output assertionsresult.tasks(TaskOutcome.FAILED)*.path.contains(...)toassertThat(result).task(":taskName").failed()Claude Code Metrics
Migration Notes
Test Migration Errors - ConjureLocalPluginTest
Error 1: TestVersions class not found during compilation
Error:
cannot find symbol - variable TestVersions(7 occurrences)Cause:
TestVersions.javawas located insrc/test/groovy/directory. The Java compiler (compileTestJava) only compiles sources insrc/test/java/, so it could not resolveTestVersionsreferenced from the migrated Java test.Fix: Moved
TestVersions.javafromsrc/test/groovy/com/palantir/gradle/conjure/tosrc/test/java/com/palantir/gradle/conjure/. The Groovy compiler (compileTestGroovy) depends oncompileTestJavaoutput, so existing Groovy tests still compile successfully since they can reference the Java-compiledTestVersionsclass.Error 2: StrictUnusedVariable Error Prone check for SubProject parameters
Error:
[StrictUnusedVariable] The parameter 'java' is never read(and similar forpostman)Cause: Initially used
SubProject javaandSubProject postmanas method parameters to create subprojects (mirroring the originaladdSubproject("java")/addSubproject("postman")calls). However, these SubProject variables were never read in the method bodies - they were only needed for the side effect of creating the subproject. The Palantir Error ProneStrictUnusedVariablecheck flagged these.Fix: Replaced unused
SubProjectparameter injection withrootProject.subproject("name")calls inside the method body. This creates the subproject without introducing an unused parameter. Tests that DO use the SubProject variable (e.g.,generate_conjure_generates_code_in_subprojectsandsupports_custom_postman_generator) kept SubProject parameter injection.Second Pass Review Notes
.plugins().add("com.palantir.conjure-local")used instead ofapply plugin:in text block.as()descriptions are used on file assertions and output assertions where context is helpful.append()calls used (no multiple calls per block)// ***DELINEATOR FOR REVIEW: expectcomment incustom_generator_throws_if_generator_missingfor consistency with original formattingTo enable or disable this check, please contact the maintainers of Excavator.