Bug #2560
closedmvn integration-test doesn't seem to run the tests
0%
Description
When I run "mvn integration-test" it doesn't seem to run the tests. I can even delete the integration-tests folder and it doesn't seem to care. Does pom.xml need to mention this folder, like testSourceDirectory mentions the tests folder?
(We may have had this in an earlier version of pom.xml...)
Updated by Andrew Brown over 9 years ago
Good call. I thought we put integration-test stuff in there... but I'm looking now and... nope. I will look into this one.
Updated by Andrew Brown over 9 years ago
In PR https://github.com/named-data/jndn/pull/6, I did add a sub-POM that closely mirrors the one in /examples; basically you call mvn -q test -DclassName=...
. Some tests, like the one I added for the PR, https://github.com/named-data/jndn/blob/remote-prefix-registration/integration-tests/src/net/named_data/jndn/tests/integration_tests/TestRemotePrefixRegistration.java#L47, use additional parameters that are environment-specific so this may be viable options.
The downsides are that you have to change directory to /integration-tests to run and you would run them one at a time; the advantages are its simple and test parameters would be configurable from the command line. There are other options, like http://maven.apache.org/surefire/maven-failsafe-plugin/, but that adds some more complexity. Thoughts?
Updated by Anonymous over 9 years ago
I think we should use the Failsafe plugin so that "mvn verify" at the top level runs all the integration tests. We can also add the sub pom.xml in the integration-tests folder for running individual tests. If there is an integration test which requires extra parameters or setup, we can exclude it from "mvn verify" at the top level. What do you think?
Updated by Andrew Brown over 9 years ago
Sounds good; why don't you add the failsafe XML to the global POM (let me know if you want me to jump in on that) and I will continue work on the sub POM in the PR. If/when we merge, then I will exclude the RemotePrefixRegistrationTest from the global because it requires an external IP.
Updated by Anonymous over 9 years ago
Can you jump in with adding Failsafe to the global POM?
Updated by Andrew Brown over 9 years ago
Jeff, check out the branch I published. I had to move the integration-tests back under the global tests folder for failsafe to work as expected. Try mvn verify
and then mvn verify -P with-integration-tests
; I would prefer not running NFD-required tests by default because not all dev systems (i.e. mine) have NFD installed.
Updated by Anonymous over 9 years ago
- Status changed from New to In Progress
Hi Andrew. Sounds good and thanks for using the convention for the branch name. It works for me after updating a few paths like this: https://github.com/named-data/jndn/commit/138d724683c0102fd30ed30da85cab11d9822872
One question: Why is it necessary to put import src.net.named_data.jndn.tests.integration_tests.*
in all the integration test files?
Updated by Andrew Brown over 9 years ago
Jeff, I believe that was an auto-refactor artifact and not intentional; I removed them in the latest commit.
Updated by Anonymous over 9 years ago
- Status changed from In Progress to Closed
Great, thanks. I merged to master and will make a Maven release.