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
4 changes: 2 additions & 2 deletions hadoop-ozone/dist/src/main/compose/test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rm "$ALL_RESULT_DIR/*"
RESULT=0
IFS=$'\n'
# shellcheck disable=SC2044
for test in $(find "$SCRIPT_DIR" -name test.sh); do
for test in $(find "$SCRIPT_DIR" -name test.sh | sort); do
echo "Executing test in $(dirname "$test")"

#required to read the .env file from the right location
Expand All @@ -41,7 +41,7 @@ for test in $(find "$SCRIPT_DIR" -name test.sh); do
echo "ERROR: Test execution of $(dirname "$test") is FAILED!!!!"
fi
RESULT_DIR="$(dirname "$test")/result"
cp "$RESULT_DIR"/robot-*.xml "$ALL_RESULT_DIR"
cp "$RESULT_DIR"/robot-*.xml "$RESULT_DIR"/docker-*.log "$ALL_RESULT_DIR"/
done

rebot -N "smoketests" -d "$SCRIPT_DIR/result" "$SCRIPT_DIR/result/robot-*.xml"
Expand Down
12 changes: 7 additions & 5 deletions hadoop-ozone/dist/src/main/compose/testlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ wait_for_datanodes(){
sleep 2
done
echo "WARNING! Datanodes are not started successfully. Please check the docker-compose files"
return 1
}

## @description Starts a docker-compose based test environment
Expand All @@ -86,13 +87,14 @@ start_docker_env(){

create_results_dir

docker-compose -f "$COMPOSE_FILE" down
docker-compose -f "$COMPOSE_FILE" up -d --scale datanode="${datanode_count}" \
docker-compose -f "$COMPOSE_FILE" --no-ansi down
docker-compose -f "$COMPOSE_FILE" --no-ansi up -d --scale datanode="${datanode_count}" \
&& wait_for_datanodes "$COMPOSE_FILE" "${datanode_count}" \
&& sleep 10

if [[ $? -gt 0 ]]; then
docker-compose -f "$COMPOSE_FILE" down
OUTPUT_NAME="$COMPOSE_ENV_NAME"
stop_docker_env
return 1
fi
}
Expand Down Expand Up @@ -136,9 +138,9 @@ execute_command_in_container(){

## @description Stops a docker-compose based test environment (with saving the logs)
stop_docker_env(){
docker-compose -f "$COMPOSE_FILE" logs > "$RESULT_DIR/docker-$OUTPUT_NAME.log"
docker-compose -f "$COMPOSE_FILE" --no-ansi logs > "$RESULT_DIR/docker-$OUTPUT_NAME.log"
if [ "${KEEP_RUNNING:-false}" = false ]; then
docker-compose -f "$COMPOSE_FILE" down
docker-compose -f "$COMPOSE_FILE" --no-ansi down
fi
}

Expand Down