From 8ae5dec1db026ed45fd7a98a641e15fc3b372250 Mon Sep 17 00:00:00 2001 From: "Kai A. Hiller" Date: Fri, 21 Jan 2022 22:41:41 +0100 Subject: [PATCH] Guard against tests being skipped --- matrix-synapse.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/matrix-synapse.spec b/matrix-synapse.spec index 69182ed..15b6bc7 100644 --- a/matrix-synapse.spec +++ b/matrix-synapse.spec @@ -66,7 +66,19 @@ install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf %check -PYTHONPATH=%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}:$PWD trial-3 tests +set -o pipefail +PYTHONPATH=%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}:$PWD trial-3 tests | tee trial.stdout + +# Guard against new types of tests being skipped. +WHITELIST="Requires hiredis +Requires jaeger_client +Requires Postgres" +REASONS=$(cat trial.stdout | sed -n '/^\[SKIPPED\]$/{n;p;}') +SKIPPED=$(comm -23 <(echo "$REASONS" | sort | uniq) <(echo "$WHITELIST" | sort | uniq)) +if [ ! -z "$SKIPPED" ]; then + echo -e "Failing, because tests were skipped:\n$SKIPPED" + exit 1 +fi %pre