diff options
author | Aleksander Mistewicz <a.mistewicz@samsung.com> | 2017-04-10 10:44:25 +0200 |
---|---|---|
committer | Aleksander Mistewicz <a.mistewicz@samsung.com> | 2017-08-04 11:41:37 +0200 |
commit | 4f1d770183b076aee2763706645143ecbf709a71 (patch) | |
tree | 24c6b87926d1abc7988e98529dfd5ca2d0408613 | |
parent | 40b876e628c37c439dd06cc73cb8f30c8d87e8ad (diff) | |
download | major-4f1d770183b076aee2763706645143ecbf709a71.tar.gz major-4f1d770183b076aee2763706645143ecbf709a71.tar.bz2 major-4f1d770183b076aee2763706645143ecbf709a71.zip |
Add testresult_*.xml file generation
Add hook call.
Avoid symlinking non-existing files.
Change-Id: Idd81bdc6c634e93bfcb966a35cbfda879f446d0f
-rwxr-xr-x | tsp/jobs/publish.sh | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/tsp/jobs/publish.sh b/tsp/jobs/publish.sh index 4e15730..4540aea 100755 --- a/tsp/jobs/publish.sh +++ b/tsp/jobs/publish.sh @@ -108,16 +108,21 @@ SNAPSHOT_SCREENSHOT_FILE="${WS_TEST}/snapshot_screenshot_${TARGET}-${PROFILE}.pn SNAPSHOT_SYSCTL_FILE="${WS_TEST}/snapshot_sysctl_${TARGET}-${PROFILE}" SCREENSHOT_DIFF_FILE="${IMG_WORKDIR}/diff.png" TAG_FILE="${IMG_WORKDIR}/tag" +XML_FILE="${IMG_WORKDIR}/testresult_${TARGET}.xml" SNAPSHOT_JSON="${WS_TEST}/snapshot_avocado-${TARGET}.json" PRERELEASE_JSON="${IMG_WORKDIR}/avocado-results/latest/results.json" +update_symlink() { + test -f "$1" && ln -Tsf "$1" "$2" +} + if grep -q "Snapshot" "${DIFF_FILE}" then echo "Processing snapshot: skip comparison, link new results" - ln -Tsf "$SYSCTL_FILE" "$SNAPSHOT_SYSCTL_FILE" - ln -Tsf "$PRERELEASE_JSON" "$SNAPSHOT_JSON" - ln -Tsf "$SCREENSHOT_FILE" "$SNAPSHOT_SCREENSHOT_FILE" + update_symlink "$SYSCTL_FILE" "$SNAPSHOT_SYSCTL_FILE" + update_symlink "$PRERELEASE_JSON" "$SNAPSHOT_JSON" + update_symlink "$SCREENSHOT_FILE" "$SNAPSHOT_SCREENSHOT_FILE" SNAPSHOT_WS_DOWNLOAD_NEW_PROFILE="${SNAPSHOT_WS_DOWNLOAD_NEW}-${PROFILE}" test -L "${SNAPSHOT_WS_DOWNLOAD_NEW_PROFILE}" && mv -T "${SNAPSHOT_WS_DOWNLOAD_NEW_PROFILE}" "${SNAPSHOT_WS_DOWNLOAD}-${PROFILE}" TAG="Snapshot" @@ -137,7 +142,10 @@ else echo "Compare screenshots" SCREENSHOT_DIFF="$(compare "${SCREENSHOT_FILE}" "${SNAPSHOT_SCREENSHOT_FILE}" -metric phash "${SCREENSHOT_DIFF_FILE}" 2>&1)" \ && SCREENSHOT_DIFF="${SCREENSHOT_DIFF%.*}" \ - || echo "Command failed: compare" + || { + echo "Command failed: compare" + SCREENSHOT_DIFF="" + } fi AVOCADO_TAG=$("${TSP_DIR}/scripts/publish_cmp.py" "$SNAPSHOT_JSON" "$PRERELEASE_JSON") else @@ -152,20 +160,43 @@ echo "$TAG" > "$TAG_FILE" test -n "$AVOCADO_TAG" || AVOCADO_TAG="$TAG" -if [ "$AVOCADO_TAG" = "OK" ] && [ -n "$SCREENSHOT_DIFF" ] && [ "$SCREENSHOT_DIFF" -gt 0 ] +OVERALL_TAG="$AVOCADO_TAG" +SCREENSHOT_TAG="Fail" + +if [ -n "$SCREENSHOT_DIFF" ] then - echo "Screenshots are different, overwrite AVOCADO_TAG" - AVOCADO_TAG="Unclear" + if [ "$SCREENSHOT_DIFF" -gt 0 ] + then + echo "Screenshots are different, overwrite AVOCADO_TAG" + SCREENSHOT_TAG="Unclear" + OVERALL_TAG="Unclear" + else + SCREENSHOT_TAG="OK" + fi fi echo "SR: $SR" -echo "TAG: $TAG" +echo "SMOKE_TAG: $TAG" echo "AVOCADO_TAG: $AVOCADO_TAG" +echo "SCREENSHOT_TAG: $SCREENSHOT_TAG" +echo "OVERALL_TAG: $OVERALL_TAG" echo "TARGET: $TARGET" echo "PROFILE: $PROFILE" +case "$TAG" in + *Fail*|*Unclear*|*OK*) + if [ -x "${TSP_DIR}/scripts/publish_hook.sh" ] + then + . "${TSP_DIR}/scripts/publish_hook.sh" + fi + ;; + *) + echo "not a test result. ignoring..." + ;; +esac + # Publish to database -update_db "$SR" "$AVOCADO_TAG" "$BUILD_NR" "$TARGET" +update_db "$SR" "$OVERALL_TAG" "$BUILD_NR" "$TARGET" # Remove all queued WWW jobs for i in $(tsresults | grep "queued.*WWW" | grep -o "^[0-9]*") |