From 565fa8999671d5c3393263d9fcf421ab1cfd76dc Mon Sep 17 00:00:00 2001 From: Wei-Chiu Chuang Date: Fri, 5 Apr 2019 15:52:53 -0700 Subject: [PATCH] HBASE-22173. Update doc on integration tests. Change-Id: Ia624ac92ba9f652f0163c814c4d055655c1aceb8 --- src/main/asciidoc/_chapters/developer.adoc | 31 ++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/main/asciidoc/_chapters/developer.adoc b/src/main/asciidoc/_chapters/developer.adoc index f728236..a3783af 100644 --- a/src/main/asciidoc/_chapters/developer.adoc +++ b/src/main/asciidoc/_chapters/developer.adoc @@ -1386,21 +1386,40 @@ mvn verify ---- If you just want to run the integration tests in top-level, you need to run two commands. -First: +mvn failsafe:integration-test+ This actually runs ALL the integration tests. +First: +---- +mvn failsafe:integration-test +---- + +This actually runs ALL the integration tests. NOTE: This command will always output `BUILD SUCCESS` even if there are test failures. At this point, you could grep the output by hand looking for failed tests. -However, maven will do this for us; just use: +mvn - failsafe:verify+ The above command basically looks at all the test results (so don't remove the 'target' directory) for test failures and reports the results. +However, maven will do this for us; just use: +---- +mvn failsafe:verify +---- + +The above command basically looks at all the test results (so don't remove the 'target' directory) for test failures and reports the results. [[maven.build.commands.integration.tests2]] ===== Running a subset of Integration tests This is very similar to how you specify running a subset of unit tests (see above), but use the property `it.test` instead of `test`. -To just run `IntegrationTestClassXYZ.java`, use: +mvn - failsafe:integration-test -Dit.test=IntegrationTestClassXYZ+ The next thing you might want to do is run groups of integration tests, say all integration tests that are named IntegrationTestClassX*.java: +mvn failsafe:integration-test -Dit.test=*ClassX*+ This runs everything that is an integration test that matches *ClassX*. This means anything matching: "**/IntegrationTest*ClassX*". You can also run multiple groups of integration tests using comma-delimited lists (similar to unit tests). Using a list of matches still supports full regex matching for each of the groups. This would look something like: +mvn - failsafe:integration-test -Dit.test=*ClassX*, *ClassY+ +To just run `IntegrationTestClassXYZ.java`, use: +---- +mvn failsafe:integration-test -Dit.test=IntegrationTestClassXYZ -DfailIfNoTests=false +---- +The next thing you might want to do is run groups of integration tests, say all integration tests that are named IntegrationTestClassX*.java: +---- +mvn failsafe:integration-test -Dit.test=*ClassX* -DfailIfNoTests=false -DfailIfNoTests=false +---- + +This runs everything that is an integration test that matches *ClassX*. This means anything matching: "**/IntegrationTest*ClassX*". You can also run multiple groups of integration tests using comma-delimited lists (similar to unit tests). Using a list of matches still supports full regex matching for each of the groups. This would look something like: +---- +mvn failsafe:integration-test -Dit.test=*ClassX*,*ClassY -DfailIfNoTests=false +---- [[maven.build.commands.integration.tests.distributed]] ==== Running integration tests against distributed cluster -- 2.5.3