Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITests don't work when a test class is specified with -Dtest=... #1062

Closed
tadayosi opened this issue Feb 25, 2021 · 2 comments
Closed

ITests don't work when a test class is specified with -Dtest=... #1062

tadayosi opened this issue Feb 25, 2021 · 2 comments
Labels
testing Issues related to tests and testing in general

Comments

@tadayosi
Copy link
Member

tadayosi commented Feb 25, 2021

For instance, this works:

mvn -DskipIntegrationTests=false verify -pl tests/itests-timer

but this doesn't:

mvn -DskipIntegrationTests=false -Dtest=CamelSourceTimerITCase verify -pl tests/itests-timer

Looking at the target/tests.log I can see these lines:

2021-02-25 12:22:38,065 [main ] DEBUG org.apache.camel.kafkaconnector.common.PluginPathHelper - Base dir used for search: /home/tasato/projects/apache/camel-kafka-connector/tests/itests-timer/null/connectors/camel-timer-kafka-connector
2021-02-25 12:22:38,067 [main ] INFO org.apache.camel.kafkaconnector.common.PluginPathHelper - Returning the following directories for the plugin path:

so this code from PluginPathHelper doesn't work well when a test runs with -Dtest=.... The system property project.basedir doesn't seem to be always reliable.

            String path = System.getProperty("project.basedir") + File.separator + module;
@tadayosi tadayosi added bug Something isn't working testing Issues related to tests and testing in general labels Feb 25, 2021
@ffang
Copy link
Contributor

ffang commented Feb 25, 2021

Hi @tadayosi,

Please try with "-Dit.test=" instead of "-Dtest="
It's failsafe plugin, not the surefire plugin which launch the test.

Cheers
Freeman

@tadayosi
Copy link
Member Author

@ffang Thanks! Yes, you're correct. It's resolved.

@tadayosi tadayosi removed the bug Something isn't working label Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Issues related to tests and testing in general
Projects
None yet
Development

No branches or pull requests

2 participants