Skip to content

CLP-212: Migrate scanner test fixtures#5818

Merged
vdiez merged 2 commits into
masterfrom
codex/clp-212-scanner-fixtures
Jul 17, 2026
Merged

CLP-212: Migrate scanner test fixtures#5818
vdiez merged 2 commits into
masterfrom
codex/clp-212-scanner-fixtures

Conversation

@vdiez

@vdiez vdiez commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the SonarQube implementation artifact with scanner-engine 13.4.1 test fixtures across affected modules
  • migrate moved scanner implementation imports and use TestSonarRuntime
  • remove unused implementation and Plugin API test-fixture dependencies from modules that need neither
  • declare JUnit 4 directly where the removed artifact previously supplied it transitively

Dependency 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-impl and sensor-test-fixtures; java-frontend also directly declares sonar-scanner-extension-framework for PropertyDefinitions. All scanner artifacts use 13.4.1.4007. The four modules whose forbidden-API checks inspect RunWith now declare JUnit 4 directly. The resolved Maven graph contains no sonar-plugin-api-impl.

sonar-plugin-api-test-fixtures is retained only in modules that still use its logging helpers.

Validation

  • affected reactor test compilation on Java 26
  • Maven dependency-tree check for org.sonarsource.sonarqube:sonar-plugin-api-impl (no matches)
  • git diff --check

Running the complete local test suite additionally requires the repository's prebuilt java-checks-test-sources/*/target/test-classpath.txt inputs; affected test compilation is green without them.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

CLP-212

@vdiez
vdiez force-pushed the codex/clp-212-scanner-fixtures branch from 6f8644e to 7283b9d Compare July 17, 2026 13:23

@aurelien-coet-sonarsource aurelien-coet-sonarsource 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.

LGTM, just a small question.

Comment thread external-reports/pom.xml
Comment on lines +61 to +65
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>

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.

Why is this now an explicit dependency ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added a comment in the pom directly so we don't lose track of why this is needed

@vdiez
vdiez force-pushed the codex/clp-212-scanner-fixtures branch from b6f5382 to 2c763d5 Compare July 17, 2026 14:30
@sonarqube-next

Copy link
Copy Markdown

@vdiez
vdiez merged commit 5b1aafe into master Jul 17, 2026
17 checks passed
@vdiez
vdiez deleted the codex/clp-212-scanner-fixtures branch July 17, 2026 14:49
@gitar-bot

gitar-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Migrates scanner test fixtures to version 13.4.1 and decouples dependencies from the SonarQube implementation artifact. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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