Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/post-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ on:
push:
schedule:
- cron: 30 0,12 * * *
env:
FAIL_FAST: ${{ github.event_name == 'pull_request' }}
jobs:
compile:
runs-on: ubuntu-18.04
strategy:
matrix:
java: [ 8, 11 ]
fail-fast: false
fail-fast: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout project
uses: actions/checkout@v2
Expand Down Expand Up @@ -187,7 +189,7 @@ jobs:
- secure
- unsecure
- misc
fail-fast: false
fail-fast: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout project
uses: actions/checkout@v2
Expand Down Expand Up @@ -232,7 +234,7 @@ jobs:
- client
- filesystem-hdds
- ozone
fail-fast: false
fail-fast: ${{ github.event_name == 'pull_request' }}
steps:
- name: Setup link to SSD
run: sudo mkdir mnt && sudo mount --bind /mnt `pwd`/mnt && sudo chmod 777 mnt
Expand Down
18 changes: 16 additions & 2 deletions hadoop-ozone/dev-support/checks/junit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,23 @@ cd "$DIR/../../.." || exit 1
: ${CHECK:="unit"}
: ${ITERATIONS:="1"}

declare -i ITERATIONS
if [[ ${ITERATIONS} -le 0 ]]; then
ITERATIONS=1
fi

export MAVEN_OPTS="-Xmx4096m"
MAVEN_OPTIONS='-B -Dskip.npx -Dskip.installnpx'
mvn ${MAVEN_OPTIONS} -DskipTests clean install

if [[ "${FAIL_FAST:-}" == "true" ]]; then
MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-fast -Dsurefire.skipAfterFailureCount=1"
else
MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-at-end"
fi

if [[ "${CHECK}" == "integration" ]] || [[ ${ITERATIONS} -gt 1 ]]; then
mvn ${MAVEN_OPTIONS} -DskipTests clean install
fi

REPORT_DIR=${OUTPUT_DIR:-"$DIR/../../../target/${CHECK}"}
mkdir -p "$REPORT_DIR"
Expand All @@ -37,7 +51,7 @@ for i in $(seq 1 ${ITERATIONS}); do
mkdir -p "${REPORT_DIR}"
fi

mvn ${MAVEN_OPTIONS} -fae "$@" test \
mvn ${MAVEN_OPTIONS} "$@" test \
| tee "${REPORT_DIR}/output.log"
irc=$?

Expand Down
13 changes: 2 additions & 11 deletions hadoop-ozone/dist/src/main/compose/ozone-mr/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ source "$SCRIPT_DIR/../testlib.sh"
tests=$(find_tests)
cd "$SCRIPT_DIR"

RESULT=0
# shellcheck disable=SC2044
for t in ${tests}; do
d="$(dirname "${t}")"

if ! run_test_script "${d}"; then
RESULT=1
fi

copy_results "${d}" "${ALL_RESULT_DIR}"
done
run_test_scripts ${tests}
RESULT=$?

exit ${RESULT}
13 changes: 2 additions & 11 deletions hadoop-ozone/dist/src/main/compose/test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,8 @@ fi
tests=$(find_tests)
cd "$SCRIPT_DIR"

RESULT=0
# shellcheck disable=SC2044
for t in ${tests}; do
d="$(dirname "${t}")"

if ! run_test_script "${d}"; then
RESULT=1
fi

copy_results "${d}" "${ALL_RESULT_DIR}"
done
run_test_scripts ${tests}
RESULT=$?

rebot --nostatusrc -N acceptance -d "$ALL_RESULT_DIR" "$ALL_RESULT_DIR"/*.xml

Expand Down
26 changes: 23 additions & 3 deletions hadoop-ozone/dist/src/main/compose/testlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ create_results_dir() {
## @description find all the test.sh scripts in the immediate child dirs
find_tests(){
if [[ -n "${OZONE_ACCEPTANCE_SUITE}" ]]; then
tests=$(find . -mindepth 2 -maxdepth 2 -name test.sh | xargs grep -l "^#suite:${OZONE_ACCEPTANCE_SUITE}$" | sort)
tests=$(find . -mindepth 2 -maxdepth 2 -name test.sh | cut -c3- | xargs grep -l "^#suite:${OZONE_ACCEPTANCE_SUITE}$" | sort)

# 'misc' is default suite, add untagged tests, too
if [[ "misc" == "${OZONE_ACCEPTANCE_SUITE}" ]]; then
untagged="$(find . -mindepth 2 -maxdepth 2 -name test.sh | xargs grep -L "^#suite:")"
untagged="$(find . -mindepth 2 -maxdepth 2 -name test.sh | cut -c3- | xargs grep -L "^#suite:")"
if [[ -n "${untagged}" ]]; then
tests=$(echo ${tests} ${untagged} | xargs -n1 | sort)
fi
Expand All @@ -55,7 +55,7 @@ find_tests(){
exit 1
fi
else
tests=$(find . -mindepth 2 -maxdepth 2 -name test.sh | grep "${OZONE_TEST_SELECTOR:-""}" | sort)
tests=$(find . -mindepth 2 -maxdepth 2 -name test.sh | cut -c3- | grep "${OZONE_TEST_SELECTOR:-""}" | sort)
fi
echo $tests
}
Expand Down Expand Up @@ -331,6 +331,26 @@ run_test_script() {
return ${ret}
}

run_test_scripts() {
ret=0

for t in "$@"; do
d="$(dirname "${t}")"

if ! run_test_script "${d}"; then
ret=1
fi

copy_results "${d}" "${ALL_RESULT_DIR}"

if [[ "${ret}" == "1" ]] && [[ "${FAIL_FAST:-}" == "true" ]]; then
break
fi
done

return ${ret}
}

## @description Make `OZONE_VOLUME_OWNER` the owner of the `OZONE_VOLUME`
## directory tree (required in Github Actions runner environment)
fix_data_dir_permissions() {
Expand Down
13 changes: 2 additions & 11 deletions hadoop-ozone/dist/src/main/compose/upgrade/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,8 @@ source "$SCRIPT_DIR/../testlib.sh"
tests=$(find_tests)
cd "$SCRIPT_DIR"

RESULT=0
# shellcheck disable=SC2044
for t in ${tests}; do
d="$(dirname "${t}")"

if ! run_test_script "${d}"; then
RESULT=1
fi

copy_results "${d}" "${ALL_RESULT_DIR}"
done
run_test_scripts ${tests}
RESULT=$?

generate_report "upgrade" "${ALL_RESULT_DIR}"

Expand Down
6 changes: 3 additions & 3 deletions hadoop-ozone/dist/src/test/shell/compose_testlib.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ 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" ]]
[[ "$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" ]]
[[ "$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" ]]
[[ "$output" == "test1/test.sh test2/test.sh" ]]
}