🔧 Use current target name in failed test artifact
This commit is contained in:
@@ -102,7 +102,4 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: log_${{ matrix.version }}_${{ matrix.session }}
|
name: log_${{ matrix.version }}_${{ matrix.session }}
|
||||||
path: |
|
path: tests/output/
|
||||||
fail.log
|
|
||||||
screen.png
|
|
||||||
crop.png
|
|
||||||
+9
-7
@@ -89,14 +89,16 @@ do_in_pod() {
|
|||||||
podman exec --user gnomeshell --workdir /home/gnomeshell "${POD}" set-env.sh "$@"
|
podman exec --user gnomeshell --workdir /home/gnomeshell "${POD}" set-env.sh "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# This is called whenever a test fails. It prints an error message (given as first
|
# This is called whenever a test fails. It prints an error message (given as second
|
||||||
# parameter), captures a screenshot to "fail.png" and stores a log in "fail.log".
|
# parameter), saves a current screenshot, the current cropped target and a log to
|
||||||
|
# "tests/output/".
|
||||||
fail() {
|
fail() {
|
||||||
echo "${1}"
|
echo "${2}"
|
||||||
mv "${WORK_DIR}/crop.png" .
|
mkdir "tests/output"
|
||||||
mv "${WORK_DIR}/screen.png" .
|
mv "${WORK_DIR}/crop.png" "tests/output/${1}"
|
||||||
|
mv "${WORK_DIR}/screen.png" tests/output/
|
||||||
LOG=$(do_in_pod sudo journalctl)
|
LOG=$(do_in_pod sudo journalctl)
|
||||||
echo "${LOG}" > fail.log
|
echo "${LOG}" > tests/output/fail.log
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +115,7 @@ compare_with_target() {
|
|||||||
DIFF=$(compare "${WORK_DIR}/crop.png" "${1}" -metric NCC "${WORK_DIR}/diff.png" 2>&1) || true
|
DIFF=$(compare "${WORK_DIR}/crop.png" "${1}" -metric NCC "${WORK_DIR}/diff.png" 2>&1) || true
|
||||||
|
|
||||||
if (( $(echo "$DIFF < 0.9" |bc -l) )); then
|
if (( $(echo "$DIFF < 0.9" |bc -l) )); then
|
||||||
fail "${2}"
|
fail "${1}" "${2}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user