This is an automated email from the ASF dual-hosted git repository.
elek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 183f4b4 HDDS-5242. Skip `failing` acceptance suite by default (#2263)
183f4b4 is described below
commit 183f4b4aaf2d811d975f6f71d856604089183131
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Wed Jun 2 15:01:41 2021 +0200
HDDS-5242. Skip `failing` acceptance suite by default (#2263)
---
hadoop-ozone/dist/src/main/compose/testlib.sh | 16 ++++++++++++----
.../dist/src/test/shell/compose_testlib.bats | 13 +++++++++++++
.../{compose_testlib.bats => failing1/test.sh} | 22 +---------------------
3 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/hadoop-ozone/dist/src/main/compose/testlib.sh
b/hadoop-ozone/dist/src/main/compose/testlib.sh
index 695970b..9669c38 100755
--- a/hadoop-ozone/dist/src/main/compose/testlib.sh
+++ b/hadoop-ozone/dist/src/main/compose/testlib.sh
@@ -40,13 +40,19 @@ create_results_dir() {
}
## @description find all the test.sh scripts in the immediate child dirs
+all_tests_in_immediate_child_dirs() {
+ find . -mindepth 2 -maxdepth 2 -name test.sh | cut -c3- | sort
+}
+
+## @description Find all test.sh scripts in immediate child dirs,
+## @description applying OZONE_ACCEPTANCE_SUITE or OZONE_TEST_SELECTOR filter.
find_tests(){
if [[ -n "${OZONE_ACCEPTANCE_SUITE}" ]]; then
- tests=$(find . -mindepth 2 -maxdepth 2 -name test.sh | cut -c3- | xargs
grep -l "^#suite:${OZONE_ACCEPTANCE_SUITE}$" | sort)
+ tests=$(all_tests_in_immediate_child_dirs | xargs grep -l
"^#suite:${OZONE_ACCEPTANCE_SUITE}$")
# 'misc' is default suite, add untagged tests, too
if [[ "misc" == "${OZONE_ACCEPTANCE_SUITE}" ]]; then
- untagged="$(find . -mindepth 2 -maxdepth 2 -name test.sh | cut -c3- |
xargs grep -L "^#suite:")"
+ untagged="$(all_tests_in_immediate_child_dirs | xargs grep -L
"^#suite:")"
if [[ -n "${untagged}" ]]; then
tests=$(echo ${tests} ${untagged} | xargs -n1 | sort)
fi
@@ -55,9 +61,11 @@ find_tests(){
if [[ -z "${tests}" ]]; then
echo "No tests found for suite ${OZONE_ACCEPTANCE_SUITE}"
exit 1
- fi
+ fi
+ elif [[ -n "${OZONE_TEST_SELECTOR}" ]]; then
+ tests=$(all_tests_in_immediate_child_dirs | grep "${OZONE_TEST_SELECTOR}")
else
- tests=$(find . -mindepth 2 -maxdepth 2 -name test.sh | cut -c3- | grep
"${OZONE_TEST_SELECTOR:-""}" | sort)
+ tests=$(all_tests_in_immediate_child_dirs | xargs grep -L
'^#suite:failing')
fi
echo $tests
}
diff --git a/hadoop-ozone/dist/src/test/shell/compose_testlib.bats
b/hadoop-ozone/dist/src/test/shell/compose_testlib.bats
index 3fcf363..285eac4 100644
--- a/hadoop-ozone/dist/src/test/shell/compose_testlib.bats
+++ b/hadoop-ozone/dist/src/test/shell/compose_testlib.bats
@@ -18,6 +18,12 @@
load ../../main/compose/testlib.sh
@test "Find test recursive, only on one level" {
cd $BATS_TEST_DIRNAME
+ result=$(all_tests_in_immediate_child_dirs | xargs)
+ [[ "$result" == "failing1/test.sh test1/test.sh test2/test.sh test4/test.sh"
]]
+}
+
+@test "Find tests without explicit filter" {
+ cd $BATS_TEST_DIRNAME
run find_tests
[[ "$output" == "test1/test.sh test2/test.sh test4/test.sh" ]]
}
@@ -29,6 +35,13 @@ load ../../main/compose/testlib.sh
[[ "$output" == "test4/test.sh" ]]
}
+@test "Find failing test suite explicitly" {
+ OZONE_ACCEPTANCE_SUITE=failing
+ cd $BATS_TEST_DIRNAME
+ run find_tests
+ [[ "$output" == "failing1/test.sh" ]]
+}
+
@test "Find test default suite" {
OZONE_ACCEPTANCE_SUITE=misc
cd $BATS_TEST_DIRNAME
diff --git a/hadoop-ozone/dist/src/test/shell/compose_testlib.bats
b/hadoop-ozone/dist/src/test/shell/failing1/test.sh
similarity index 62%
copy from hadoop-ozone/dist/src/test/shell/compose_testlib.bats
copy to hadoop-ozone/dist/src/test/shell/failing1/test.sh
index 3fcf363..76bff55 100644
--- a/hadoop-ozone/dist/src/test/shell/compose_testlib.bats
+++ b/hadoop-ozone/dist/src/test/shell/failing1/test.sh
@@ -14,24 +14,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
-load ../../main/compose/testlib.sh
-@test "Find test recursive, only on one level" {
- cd $BATS_TEST_DIRNAME
- run find_tests
- [[ "$output" == "test1/test.sh test2/test.sh test4/test.sh" ]]
-}
-
-@test "Find test by suite" {
- OZONE_ACCEPTANCE_SUITE=one
- cd $BATS_TEST_DIRNAME
- run find_tests
- [[ "$output" == "test4/test.sh" ]]
-}
-
-@test "Find test default suite" {
- OZONE_ACCEPTANCE_SUITE=misc
- cd $BATS_TEST_DIRNAME
- run find_tests
- [[ "$output" == "test1/test.sh test2/test.sh" ]]
-}
+#suite:failing
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]