chihsuan commented on code in PR #11938:
URL: https://github.com/apache/ozone/pull/11938#discussion_r4504993362
##########
hadoop-ozone/dist/src/main/k8s/examples/testlib.sh:
##########
@@ -171,24 +177,24 @@ revert_resources() {
execute_robot_test() {
print_phase "Executing robot tests $@"
- mkdir -p result
CONTAINER="$1"
shift 1 #Remove first argument which was the container name
# shellcheck disable=SC2206
ARGUMENTS=($@)
- kubectl exec -it "${CONTAINER}" -- bash -c 'rm -rf /tmp/report'
- kubectl exec -it "${CONTAINER}" -- bash -c 'mkdir -p /tmp/report'
- kubectl exec -it "${CONTAINER}" -- robot --nostatusrc -d /tmp/report
${ARGUMENTS[@]-} || true
- kubectl cp "${CONTAINER}":/tmp/report/output.xml
"result/$CONTAINER-$RANDOM.xml" || true
+ kubectl exec -it "${CONTAINER}" -- robot --log NONE --nostatusrc
--outputdir /robot --report NONE --timestampoutputs ${ARGUMENTS[@]-}
}
combine_reports() {
- if [[ -d result ]]; then
- rm -f result/output.xml
- run_rebot result result "-o output.xml -N '$(basename $(pwd))' *.xml"
+ if [[ -d "${ROBOT_OUTPUT_DIR}" ]]; then
+ local title="$(basename $(pwd))"
+ kubectl exec -it "${CONTAINER}" -- rebot --logtitle "${title}" --name
"${title}" --nostatusrc \
+ --outputdir /robot --output output.xml --report NONE /robot/*.xml || true
+ rm -f result
Review Comment:
nit: for local runs, should this be `rm -fr`?
##########
hadoop-ozone/dist/src/main/k8s/examples/testlib.sh:
##########
@@ -197,3 +203,14 @@ print_phase() {
echo "**** $1 ****"
echo ""
}
+
+create_robot_dir() {
+ if [[ -z "${ROBOT_OUTPUT_DIR:-}" ]]; then
+ export ROBOT_OUTPUT_DIR="$(mktemp -d "${TMPDIR:-/tmp}"/robot-data-XXXXXX)"
+ chmod go+rwx "${ROBOT_OUTPUT_DIR}"
+ _k8s_delete_test_data() {
+ rm -frv "${ROBOT_OUTPUT_DIR}"
+ }
+ trap _k8s_delete_test_data EXIT HUP INT TERM
Review Comment:
Small one: I noticed the temp dir may stay after local runs. Could
`post_run` remove it at the end?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]