Skip to content

Excavator: Migrate Groovy nebula test AssetDistributionPluginIntegrationSpec to the new Java Junit framework#1944

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

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

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/AssetDistributionPluginIntegrationSpec.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.

The migration is complete. Here's a summary of what was done:

Files modified:

  • gradle-sls-packaging/src/test/groovy/.../AssetDistributionPluginIntegrationSpec.groovy - Added ***DELINEATOR FOR REVIEW comments to delineate test methods, when:, then:, expect: blocks, and the helper method

Files created:

  • gradle-sls-packaging/src/test/java/.../AssetDistributionPluginIntegrationTest.java - The migrated Java test
  • test-migration-errors.md - Log of errors encountered and fixes applied

Migration details:

  • All 7 tests migrated (6 regular + 1 @Disabled, previously @Ignore)
  • @GradlePluginTests and @DisabledConfigurationCache annotations added
  • createUntarBuildFile helper method migrated to return GradleFile for fluent chaining
  • Plugin application uses .plugins().add() API instead of text blocks
  • Multi-version testing handled automatically by the framework (removed where: blocks)
  • Assertions use .as() descriptions and chained AssertJ assertions
  • ObjectMapper uses YAMLFactory consistent with existing migrated tests
  • Compilation verified successfully with ./gradlew :gradle-sls-packaging:compileTestJava

One error fixed during compilation:

  • Removed unused com.palantir.gradle.dist.Versions import (class is in Groovy source set, not visible to Java compiler; no longer needed since the @Disabled test uses .plugins().add() without a version)

Claude Code Metrics

Metric Value
Total cost $2.4801325499999995
Total Duration (API) 646611 ms
Total Duration (WALL) 640434 ms
Token usage 2071 (input), 27323 (output)
Cached tokens 80091 (creation), 2190660 (read)

Migration Notes

Test Migration Errors

AssetDistributionPluginIntegrationSpec -> AssetDistributionPluginIntegrationTest

First pass errors

  1. Import error: com.palantir.gradle.dist.Versions not found
    • The Versions.java file is located in the Groovy test source set (src/test/groovy/), which is not visible to the Java test compiler.
    • The Versions.GRADLE_CONSISTENT_VERSIONS constant was only used in the original Groovy test for the @Ignored test to specify a plugin version inline. In the new framework, the plugin is added via .plugins().add("com.palantir.consistent-versions") without a version (it comes from gradlePluginForTesting), so the import was unnecessary.
    • Fix: Removed the unused import.

Second pass review changes

  1. Helper method placement - Moved createUntarBuildFile from the top of the class (after the OBJECT_MAPPER field) to the end of the class, matching the original Groovy file where it was the last method. This is also consistent with the pattern in ConfigTarTaskIntegrationTest.java.

No other changes were needed on the second pass. All best practices from the testing guide were already followed:

  • @GradlePluginTests and @DisabledConfigurationCache annotations present
  • Test names in snake_case_english_sentence format
  • Delineator comments on all tests and helper method
  • All 7 tests migrated (6 regular + 1 @disabled)
  • Plugin application via .plugins().add() API (no apply plugin: in text blocks)
  • Text blocks used throughout
  • .as() descriptions on all assertions
  • Chained assertions where applicable
  • No unused parameters in method signatures
  • SubProject injection used for dist subproject
  • Helper method returns GradleFile for fluent chaining
  • ObjectMapper uses YAMLFactory consistent with existing migrated tests

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-230c6176d37c415f branch from 7307230 to 09744f0 Compare February 1, 2026 03:38
@svc-excavator-bot svc-excavator-bot force-pushed the roomba/migrate-gradle-testing-junit-framework-230c6176d37c415f branch from 09744f0 to 6e3fd86 Compare March 1, 2026 04:26
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