Skip to content

Conversation

@henryju
Copy link
Member

@henryju henryju commented Nov 7, 2025

SCANMAVEN-324

Invoker tests are much faster than e2e tests.

Many tests can be converted from e2e to invoker.

I did some of them, but this can be continued.

Saves ~1min on the pipeline.

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title Convert e2e tests to invoker SCANMAVEN-324 Convert e2e tests to invoker Nov 7, 2025
@henryju
Copy link
Member Author

henryju commented Nov 7, 2025

@dorian-burihabwa-sonarsource this PR should be rebased on master once:

@henryju henryju marked this pull request as ready for review November 7, 2025 15:37
@henryju henryju force-pushed the jh/migrate_e2e_invoker branch from 027168f to 11c8996 Compare November 7, 2025 15:41
@henryju henryju force-pushed the jh/migrate_e2e_invoker branch from 11c8996 to 28a7c5f Compare November 12, 2025 08:21
@henryju henryju force-pushed the jh/migrate_e2e_invoker branch from 28a7c5f to 03b21c0 Compare November 14, 2025 11:10
@sonarqube-next
Copy link

@romainbrenguier
Copy link

This is not a review but just a summary of the changes to help with reviewing:

Tests Removed from Java (MavenTest.java)

The following Java test methods were removed and converted to invoker tests:

  1. useUserPropertiesGlobalConfig() (MSONAR-129)
    - → consider-properties-from-global-profiles/
  2. supportSonarHostURLParam() (MSONAR-129)
    - → env-variable-overrides-pom-properties/
  3. supportSonarHostURLParamFromEnvironmentVariable() (MSONAR-172)
    - Also related to → env-variable-overrides-pom-properties/
  4. supportMavenEncryption() + supportMavenEncryptionWithDefaultSecuritySettings() (MSONAR-141)
    - → decrypt-sonar-password-only/
  5. skipIrrelevantEncryptedEnvironmentVariables() + skipIrrelevantEncryptedMavenProperties() + skipIrrelevantEncryptedPropertyInMavenPom() (SCANMAVEN-228)
    - → decrypt-sonar-password-only/ (consolidated into single test)
  6. shouldEvaluateSourceVersionOnEachModule()
    - → java-source-from-multi-module-release-inheritance/

File Movements & Renames

Major Renames (Test directory restructuring for clarity):

Old Name New Name
java-enable-preview/ java-enablePreview-from-compiler/
java-target/ java-source-and-target-from-compiler/
java-release/ java-source-from-compiler-release/
java-release-multiple-executions/ java-source-warn-if-multiple-executions/
java-multivalued-sources/ comma-in-source-folder-name/
java-compiler-executable/ java-jdkHome-from-compiler-executable/
java-compiler-plugin-toolchain/ java-jdkHome-from-compiler-toolchain/
java-compiler-context-toolchain/ java-jdkHome-from-context-toolchain/
java-compiler-plugin-multi-toolchain/ java-jdkHome-favor-default-compile-toolchain/
java-multi-module/ multi-module-sources/
java-multi-module-with-scanAll-enabled/ scanAll-enabled/
java-multi-module-project-key-in-pom/ projectKey-overridden-in-pom/

Projects Migrated from e2e/projects/maven:

  • modules-source-versions/same-version/pom.xml → java-source-from-multi-module-release-inheritance/inherit-release/pom.xml
  • modules-source-versions/higher-version/pom.xml → java-source-from-multi-module-release-inheritance/override-release/pom.xml
  • Security settings files moved from e2e/src/test/resources/ to individual test directories

Deleted Projects (no longer needed):

  • e2e/projects/maven/irrelevant-encrypted-property/
  • e2e/projects/maven/maven-global-properties/
  • e2e/projects/maven/modules-source-versions/ (migrated as noted above)

New Invoker Test Structure

Each converted test now follows the Maven Invoker Plugin convention:

test-name/
├── invoker.properties # Test configuration (goals, profiles, settings, env vars)
├── pom.xml # Test project
├── verify.groovy # Assertions (replaces Java test code)
├── settings.xml # Optional custom Maven settings
└── [other test files]

ItUtils.java:

  • Removed createSettingsXml() method and XML manipulation code (no longer needed)
  • Removed createRepositories() and createPluginRepositories() helpers

MavenTest.java:

  • Removed 200+ lines of test code
  • Simplified to focus on remaining orchestrator-based integration tests

@github-actions
Copy link
Contributor

This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically

@github-actions github-actions bot added the stale label Nov 25, 2025
@github-actions github-actions bot closed this Dec 2, 2025
@henryju
Copy link
Member Author

henryju commented Dec 2, 2025

Ping @dorian-burihabwa-sonarsource

@henryju henryju reopened this Dec 2, 2025
@sonarqube-next
Copy link

sonarqube-next bot commented Dec 2, 2025

@github-actions github-actions bot removed the stale label Dec 3, 2025
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