feat(bin): add gotestsum-notify

This commit is contained in:
Bruno Carlin 2024-04-20 17:12:58 +02:00
parent 1ef12a1e5f
commit eaf2942873
Signed by: bcarlin
GPG key ID: 8E254EA0FFEB9B6D

19
bin/.local/bin/gotestsum-notify Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
content="Tests: $TESTS_TOTAL (skipped: $TESTS_SKIPPED)"
if [[ "$TESTS_ERRORS" != "0" ]]; then
title="⚠️ TESTS ERROR"
content="$content\nErrors: $TESTS_ERRORS"
urgency=critical
elif [[ "$TESTS_FAILED" != "0" ]]; then
title="❌ TESTS FAILED"
content="$content\nErrors: $TESTS_FAILED"
urgency=critical
else
title="✅ TESTS SUCCEDED"
urgency=normal
fi
notify-send --category gotestsum --urgency "$urgency" "$title" "\n$content"