summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtsp/jobs/publish.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tsp/jobs/publish.sh b/tsp/jobs/publish.sh
index 9d5452c..4e15730 100755
--- a/tsp/jobs/publish.sh
+++ b/tsp/jobs/publish.sh
@@ -106,6 +106,7 @@ SYSCTL_FILE="${IMG_WORKDIR}/sysctl.result"
SCREENSHOT_FILE="${IMG_WORKDIR}/screenshot.png"
SNAPSHOT_SCREENSHOT_FILE="${WS_TEST}/snapshot_screenshot_${TARGET}-${PROFILE}.png"
SNAPSHOT_SYSCTL_FILE="${WS_TEST}/snapshot_sysctl_${TARGET}-${PROFILE}"
+SCREENSHOT_DIFF_FILE="${IMG_WORKDIR}/diff.png"
TAG_FILE="${IMG_WORKDIR}/tag"
SNAPSHOT_JSON="${WS_TEST}/snapshot_avocado-${TARGET}.json"
@@ -131,6 +132,13 @@ else
if [ -f "$PRERELEASE_JSON" ]
then
TAG=$(compare_with_snapshot)
+ if [ -f "${SCREENSHOT_FILE}" ] && [ -f "${SNAPSHOT_SCREENSHOT_FILE}" ]
+ then
+ 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"
+ fi
AVOCADO_TAG=$("${TSP_DIR}/scripts/publish_cmp.py" "$SNAPSHOT_JSON" "$PRERELEASE_JSON")
else
echo "Prerelease file missing"
@@ -144,6 +152,12 @@ echo "$TAG" > "$TAG_FILE"
test -n "$AVOCADO_TAG" || AVOCADO_TAG="$TAG"
+if [ "$AVOCADO_TAG" = "OK" ] && [ -n "$SCREENSHOT_DIFF" ] && [ "$SCREENSHOT_DIFF" -gt 0 ]
+then
+ echo "Screenshots are different, overwrite AVOCADO_TAG"
+ AVOCADO_TAG="Unclear"
+fi
+
echo "SR: $SR"
echo "TAG: $TAG"
echo "AVOCADO_TAG: $AVOCADO_TAG"