Skip to content
Merged
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
21 changes: 14 additions & 7 deletions hadoop-ozone/dist/src/main/k8s/examples/test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -u -o pipefail

#
# Test executor to test all the compose/*/test.sh test scripts.
# Test executor to test all the k8s/examples/*/test.sh test scripts.
#
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )

set -ex

ALL_RESULT_DIR="$SCRIPT_DIR/result"
rm "$ALL_RESULT_DIR"/* || true
mkdir -p "$ALL_RESULT_DIR"
Expand All @@ -35,15 +34,23 @@ for test in $(find "$SCRIPT_DIR" -name test.sh | grep "${OZONE_TEST_SELECTOR:-""
TEST_NAME="$(basename "$TEST_DIR")"

echo ""
echo "#### Executing tests of ${TEST_DIR} #####"
echo "#### Executing tests of ${TEST_NAME} #####"
echo ""
cd "$TEST_DIR" || continue
./test.sh
if ! ./test.sh; then
RESULT=1
echo "ERROR: Test execution of ${TEST_NAME} is FAILED!!!!"
fi

cp "$TEST_DIR"/result/output.xml "$ALL_RESULT_DIR"/"${TEST_NAME}".xml
cp "$TEST_DIR"/result/output.xml "$ALL_RESULT_DIR"/"${TEST_NAME}".xml || true
mkdir -p "$ALL_RESULT_DIR"/"${TEST_NAME}"
mv "$TEST_DIR"/logs/*log "$ALL_RESULT_DIR"/"${TEST_NAME}"/
mv "$TEST_DIR"/logs/*log "$ALL_RESULT_DIR"/"${TEST_NAME}"/ || true

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

rebot -N "smoketests" -d "$ALL_RESULT_DIR/" "$ALL_RESULT_DIR/*.xml"

exit ${RESULT}