Skip to content

Migrate from JUnit to TestBalloon - #2192

Closed
Goooler wants to merge 7 commits into
mainfrom
g/20260814/test-balloon
Closed

Migrate from JUnit to TestBalloon#2192
Goooler wants to merge 7 commits into
mainfrom
g/20260814/test-balloon

Conversation

@Goooler

@Goooler Goooler commented Aug 14, 2026

Copy link
Copy Markdown
Member

@Goooler
Goooler force-pushed the g/20260814/test-balloon branch 11 times, most recently from df8b3bb to bece705 Compare August 16, 2026 06:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the project’s test infrastructure from JUnit 5 to TestBalloon, refactoring unit/functional/document tests to be registered via testSuite { ... } and introducing shared helpers to run and parameterize tests without JUnit annotations.

Changes:

  • Add TestBalloon-backed test registration helpers (runTests/runTest) and a lightweight Arguments carrier for destructuring.
  • Convert most unit/functional/document tests from JUnit annotations/parameter providers to TestBalloon suites and explicit loops where needed.
  • Wire TestBalloon into the build (version catalog + Gradle plugin) and update contributor docs for new --tests filtering semantics.

Reviewed changes

Copilot reviewed 46 out of 47 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/testKit/kotlin/com/github/jengelman/gradle/plugins/shadow/testkit/TestSuiteScope.kt Adds TestBalloon suite utilities (runTests, runTest, fixtures, cleanup/logging).
src/testKit/kotlin/com/github/jengelman/gradle/plugins/shadow/testkit/Arguments.kt Introduces a small arguments wrapper to support destructuring for manual parameter loops.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/XmlAppendingTransformerTest.kt Converts transformer unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ServiceFileTransformerTest.kt Converts unit tests; rewrites some test cases and replaces JUnit parameterization.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformerTest.kt Converts unit tests; replaces JUnit parameterization with explicit case loops.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PreserveFirstFoundResourceTransformerTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/MergeLicenseResourceTransformerTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ManifestAppenderTransformerTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/Log4j2PluginsCacheFileTransformerTest.kt Converts unit tests and replaces JUnit parameterization with explicit case loops.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/KotlinModuleMetadataTransformerTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/GroovyExtensionModuleTransformerTest.kt Converts unit tests; replaces JUnit parameter provider structure.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/DeduplicatingResourceTransformerTest.kt Converts unit tests; replaces JUnit lifecycle with init-based setup.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ComponentsXmlResourceTransformerTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/BaseTransformerTest.kt Refactors base unit test fixture initialization away from JUnit lifecycle/TempDir.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/AppendingTransformerTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ApacheNoticeResourceTransformerTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ApacheLicenseResourceTransformerTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPropertiesTest.kt Converts unit tests; replaces JUnit lifecycle setup with constructor/init.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/SimpleRelocatorTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/RelocatorsTest.kt Converts unit tests; replaces JUnit parameter provider with Pair-based data.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/ZipEntryValidationTest.kt Converts unit tests; replaces @TempDir with temp dir construction.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/ReproduciblePropertiesTest.kt Converts parameterized tests to explicit loops in a TestBalloon suite.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/R8MinimizerTest.kt Converts unit tests; replaces @TempDir with temp dir construction.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/MinimizeSpecsTest.kt Converts unit tests to TestBalloon suite-based execution.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/DuplicatesStrategyCheckerTest.kt Converts unit tests; replaces @TempDir with temp dir construction.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/DefaultDependencyFilterTest.kt Converts parameterized tests to explicit loops in a TestBalloon suite.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/BytecodeRemappingTest.kt Converts unit tests; replaces JUnit TempDir + parameterized coverage.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/TransformersTest.kt Converts functional transformer tests to TestBalloon suite-based execution.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ServiceFileTransformerTest.kt Converts functional tests; replaces JUnit parameterization with explicit loops.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformerTest.kt Converts functional tests to TestBalloon suite-based execution.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/GroovyExtensionModuleTransformerTest.kt Converts functional tests to TestBalloon suite-based execution.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/BaseTransformerTest.kt Refactors functional base transformer fixture setup away from JUnit lifecycle.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/AppendingTransformerTest.kt Converts functional tests to TestBalloon suite-based execution.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/RelocationTest.kt Converts relocation functional tests; replaces JUnit parameterization with explicit loops / Boolean combos.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/PublishingTest.kt Converts publishing functional tests; replaces JUnit TempDir/lifecycle with init construction.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/MinimizeTest.kt Converts minimize functional tests; replaces JUnit parameterization with Boolean combos.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/KotlinPluginsTest.kt Converts Kotlin plugin functional tests; replaces JUnit lifecycle/parameterization with suite execution.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt Converts Java plugin functional tests; replaces some JUnit parameterization with explicit loops.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/FindResourceInClasspathTest.kt Converts functional tests to TestBalloon suite-based execution.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/FilteringTest.kt Converts functional tests; replaces JUnit lifecycle/parameterization with suite execution.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/CachingTest.kt Converts functional tests to TestBalloon suite-based execution.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/BasePluginTest.kt Refactors functional test base fixture; introduces shared Maven repo to speed tests.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/ApplicationPluginTest.kt Converts application functional tests to TestBalloon suite-based execution.
src/documentTest/kotlin/com/github/jengelman/gradle/plugins/shadow/DocCodeSnippetTest.kt Converts document snippet execution to TestBalloon and configures concurrent invocation.
gradle/libs.versions.toml Adds TestBalloon version, library coordinates, and Gradle plugin alias.
CONTRIBUTING.md Updates instructions for running suites/individual tests under TestBalloon filtering.
build.gradle.kts Applies TestBalloon plugin and adds TestBalloon core dependency to test suites.
Suppressed comments (1)

src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/RelocatorsTest.kt:17

  • relocateSignaturePatterns(input, expected) will never run: runTests(::RelocatorsTest) only auto-runs no-arg / Boolean-parameter functions (see TestSuiteScope.runTests), and this suite doesn't register explicit cases from signaturePatternsProvider. This effectively drops the signature relocation test coverage.
val RelocatorsTests by testSuite {
  runTests(::RelocatorsTest)
}

private class RelocatorsTest {
  fun relocateSignaturePatterns(input: String, expected: String) {
    val actual = setOf(SimpleRelocator("org.package", "shadow.org.package")).mapName(name = input)
    assertThat(actual).isEqualTo(expected)
  }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Goooler and others added 4 commits August 16, 2026 14:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 46 out of 47 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/relocation/RelocatorsTest.kt:11

  • runTests(::RelocatorsTest) won’t execute relocateSignaturePatterns(input, expected) because runTests only auto-invokes 0-arg methods (or all-Boolean parameter combinations). As a result, signaturePatternsProvider cases are currently never run.
val RelocatorsTests by testSuite {
  runTests(::RelocatorsTest)
}

@Goooler

Goooler commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

Don't land it for now.

@Goooler Goooler closed this Aug 16, 2026
@Goooler
Goooler deleted the g/20260814/test-balloon branch August 16, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants