CLP-212: Migrate scanner test fixtures#5818
Conversation
6f8644e to
7283b9d
Compare
aurelien-coet-sonarsource
left a comment
There was a problem hiding this comment.
LGTM, just a small question.
| <dependency> | ||
| <groupId>junit</groupId> | ||
| <artifactId>junit</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> |
There was a problem hiding this comment.
Why is this now an explicit dependency ?
There was a problem hiding this comment.
JUnit 4 was already on this module's test classpath transitively through sonar-plugin-api-impl. Removing that artifact made the forbiddenapis:testCheck execution (forbid-junit4) fail because its signature file references org.junit.runner.RunWith and that class could no longer be resolved. This declaration makes that existing build-time requirement explicit; the module's tests remain on JUnit 5.
There was a problem hiding this comment.
More precisely, no JUnit test was failing. The failure was the Test Analyze CI job, in the external-reports Maven execution:
Failed to execute goal de.thetaphi:forbiddenapis:3.10:testCheck (forbid-junit4) on project external-reports: Parsing signatures failed: Class 'org.junit.runner.RunWith' not found on classpath while parsing signature: org.junit.runner.RunWith
The referenced signature is forbid_junit4.txt:9. The explicit dependency is only there so this check can resolve the class it forbids.
There was a problem hiding this comment.
added a comment in the pom directly so we don't lose track of why this is needed
b6f5382 to
2c763d5
Compare
|
Code Review ✅ ApprovedMigrates scanner test fixtures to version 13.4.1 and decouples dependencies from the SonarQube implementation artifact. No issues found. OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |





Summary
TestSonarRuntimeDependency changes
Before: analyzer tests relied on
org.sonarsource.sonarqube:sonar-plugin-api-impl, including for scanner implementation types and transitive scanner helpers.After: affected modules directly declare
plugin-api-scanner-implandsensor-test-fixtures;java-frontendalso directly declaressonar-scanner-extension-frameworkforPropertyDefinitions. All scanner artifacts use13.4.1.4007. The four modules whose forbidden-API checks inspectRunWithnow declare JUnit 4 directly. The resolved Maven graph contains nosonar-plugin-api-impl.sonar-plugin-api-test-fixturesis retained only in modules that still use its logging helpers.Validation
org.sonarsource.sonarqube:sonar-plugin-api-impl(no matches)git diff --checkRunning the complete local test suite additionally requires the repository's prebuilt
java-checks-test-sources/*/target/test-classpath.txtinputs; affected test compilation is green without them.