Repository navigation
Move parser-only test jars to the test type table - #1253
Merged
Merged
Conversation
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.
Seven jars sat on the test runtime classpath only so that
JavaParser.classpath(...)/KotlinParser.classpath(...)lookups could resolve types while parsing test sources. Nothing in the tests imports or runs them, but they still bring CVE exposure and remediation churn: javafaker 1.0.2 is unmaintained and depends on snakeyaml 1.x (only kept off the classpath by an exclusion), archunit 0.23.1 and hamcrest 1.3 are old, and javafaker, datafaker, arquillian-junit-core and testng floated onlatest.release.These are now
testParserClasspathentries in the test type table, so nothing extra ships in the published recipe jar:org.hamcrest:hamcrest-core:1.3andorg.hamcrest:hamcrest-library:1.3com.tngtech.archunit:archunit:0.23.1com.github.javafaker:javafaker:1.0.2net.datafaker:datafaker:2.+(resolves to 2.7.0, the version the tests ran against)org.jboss.arquillian.junit:arquillian-junit-core:1.10.2.Finalorg.mockito.kotlin:mockito-kotlin:5.4.0(KotlinParser.BuildersupportsclasspathFromResources, soCleanupMockitoImportsTestnow uses"mockito-core-5", "mockito-kotlin-5")org.testng:testngwas removed outright. Nothing runs TestNG; every lookup already went through the existingtestng-7main type table entry.Table lookups are prefix matches over
artifactId-version, so the names are version-qualified (hamcrest-core-1.3,hamcrest-library-1.3,javafaker-1,datafaker-2,arquillian-junit-core-1,assertj-core-3). Becausehamcrest-core-1.3andhamcrest-library-1.3now sit besidehamcrest-3.0, the two existing bare"hamcrest"lookups inAddHamcrestIfUsedTestandAddHamcrestJUnitDependencyTestbecame ambiguous; they now say"hamcrest-3", which is what they already resolved to. Regenerating the test table also movedgrpc-testingfrom 1.84.0 to 1.85.1 through its existing1.+declaration. No recipe code changed.Verified locally with
./gradlew test --continue, run onmainand on this branch with the same settings. Both ran 2392 tests with 9 skipped and identical per-test outcomes. Both had the same 3 failures (AssertToAssertionsTestx2 andJUnit5MigrationTest.extendsAssertWithUnqualifiedAssertions): static imports come out as qualifiedAssertions.calls. Unchangedmainfails the same way against the current rewrite snapshots, so this change didn't cause them. An earlier run onmainagainst older snapshots passed all 2392.dependencies --configuration testRuntimeClasspathno longer lists any of the removed jars, and no transitive copies of them remain.