summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Mistewicz <a.mistewicz@samsung.com>2017-02-01 16:29:51 (GMT)
committerAleksander Mistewicz <a.mistewicz@samsung.com>2017-03-29 10:48:09 (GMT)
commit1b8c9554ce1ea5cae832facaa139d17466c7533f (patch)
treecd7990b0a0e4ebcf049ba298b6262d5db28d8919
parentf3c23b7c8c12abf89464154cf274f22e4a965d16 (diff)
downloadmajor-1b8c9554ce1ea5cae832facaa139d17466c7533f.zip
major-1b8c9554ce1ea5cae832facaa139d17466c7533f.tar.gz
major-1b8c9554ce1ea5cae832facaa139d17466c7533f.tar.bz2
Compare screenshotsrefs/changes/31/121931/1
If screenshots are not identical and AVOCADO_TAG is set to OK then the status will be degraded to Unclear. Change-Id: I91bdb49ee630abf4d6fc81aacaf781d6bdf2b8e0 Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
-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"