From 23c64e567ea4012a743ab18e3574e3b9d9821e9e Mon Sep 17 00:00:00 2001 From: Ada Bohm Date: Wed, 27 Nov 2024 20:46:36 +0100 Subject: [PATCH] Script & instruction for image diff reporting --- parley/tests/.gitignore | 1 + parley/tests/README.md | 6 +++++- parley/tests/make_report.sh | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 parley/tests/.gitignore create mode 100644 parley/tests/make_report.sh diff --git a/parley/tests/.gitignore b/parley/tests/.gitignore new file mode 100644 index 00000000..6fca42d6 --- /dev/null +++ b/parley/tests/.gitignore @@ -0,0 +1 @@ +report.html diff --git a/parley/tests/README.md b/parley/tests/README.md index 8c9bd74f..125f7188 100644 --- a/parley/tests/README.md +++ b/parley/tests/README.md @@ -13,4 +13,8 @@ If you think that everything is ok, you can start tests as follows: $ PARLEY_TEST="accept" cargo test ``` -It will update snapshots of the failed tests. \ No newline at end of file +It will update snapshots of the failed tests. + +## Report with diffs + +If you want to create a nice report with image diffs, run `make_report.sh` diff --git a/parley/tests/make_report.sh b/parley/tests/make_report.sh new file mode 100644 index 00000000..22ed7956 --- /dev/null +++ b/parley/tests/make_report.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if ! command -v image_diff_review 2>&1 >/dev/null +then + echo "image_diff_review not found. Install it via 'cargo install image_diff_review'" + exit 1 +fi + +image_diff_review --ignore-left-missing --left-title "Current test" --right-title "Snaphost" current snapshots report