Skip to content

Remove test classes from test-infra, and include everything under main#21577

Merged
Croway merged 2 commits intoapache:mainfrom
Croway:refactor-test-infra
Feb 23, 2026
Merged

Remove test classes from test-infra, and include everything under main#21577
Croway merged 2 commits intoapache:mainfrom
Croway:refactor-test-infra

Conversation

@Croway
Copy link
Contributor

@Croway Croway commented Feb 23, 2026

During the spring boot 4 upgrade work I noticed that test-infra module structure can be improved in particular, before each test-infra module split code between src/main (infrastructure services, container implementations) and src/test (service factories, JUnit extensions). This produced two JARs per module: a regular JAR and a test-jar via maven-assembly-plugin.

Now all code lives in src/main. Each module produces a single JAR. The assembly plugin and test-jar goals are removed.

Changes made:

  • Moved src/test/java -> src/main/java in 60 test-infra modules
  • Removed assembly plugin from test-infra/pom.xml
  • Removed test-jar plugin from camel-test-infra-parent/pom.xml
  • Changed JUnit and testcontainers dependency scopes from test to compile in the parent POM (safe because consumers always use test-infra in test)
  • Removed ~113 test-jar dependency entries from component POMs
  • Removed ~60 duplicate camel-test-infra-common and redundant testcontainers entries from test-infra module POMs

Improvements

  • 1 dependency instead of 2 per test-infra module in every consumer
  • ~170 fewer dependency declarations across the codebase
  • Simpler build, no assembly plugin, no test-jar packaging
  • camel-jbang infra continues to work unchanged (it already downloaded the regular JAR)
  • No behavioral changes, all classes remain in the same packages, all tests pass

@Croway Croway force-pushed the refactor-test-infra branch from 0cbdca1 to f8f176f Compare February 23, 2026 11:56
@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@Croway Croway marked this pull request as ready for review February 23, 2026 13:04
@Croway Croway marked this pull request as draft February 23, 2026 13:09
@Croway
Copy link
Contributor Author

Croway commented Feb 23, 2026

@davsclaus @jamesnetherton @oscerd there are Camel projects that uses the test-jar test-infra dependencies

  • camel-spring-boot
  • camel-quarkus
  • camel-kafka-connector

These project need to be updated, in particular, the test-infra test-jar dependencies has to be removed, and only the test-infra dependencies with test scope should be used instead.

@davsclaus
Copy link
Contributor

awesome I had problemes with that test-jar surprise recently - nice its just a normal JAR

@Croway
Copy link
Contributor Author

Croway commented Feb 23, 2026

most probably camel-quarkus is not an issue @jamesnetherton is it right? camel-quarkus is not using camel test-infra test-jars

@davsclaus
Copy link
Contributor

you are welcome to create a github ticket for CKC so its not forgotten there - though we dont have bandwith to maintain this project.

@davsclaus
Copy link
Contributor

4.19 upgrade doc needs to be updated

@Croway
Copy link
Contributor Author

Croway commented Feb 23, 2026

I am aligning CKC and Camel Spring Boot, I do hope CKC mvn verify will work on the first try

@Croway
Copy link
Contributor Author

Croway commented Feb 23, 2026

camel kafka connector main is using camel 4.14, I won't update it than, if camel kafka connector will be updated to camel 4.19+, the changes to be done will be mentioned in the upgrade guide.

@Croway
Copy link
Contributor Author

Croway commented Feb 23, 2026

This is the only related change needed apache/camel-spring-boot#1672

@Croway Croway marked this pull request as ready for review February 23, 2026 14:03
@github-actions github-actions bot added the docs label Feb 23, 2026
@Croway Croway merged commit 05935db into apache:main Feb 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants