mirror of
https://github.com/plausible/analytics.git
synced 2025-01-09 03:26:52 +03:00
Fail CI when tests are logging (#2748)
A re-iteration of a miserable attempt from #2694 Hi @dgvncsz0f, how you've been ;D
This commit is contained in:
parent
a490016f6e
commit
05d14774be
20
.github/bin/log-watch.sh
vendored
Executable file
20
.github/bin/log-watch.sh
vendored
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
fail=false
|
||||
while read l
|
||||
do
|
||||
echo "$l"
|
||||
if echo "$l" | grep -qP '\[(warning|error)\]'
|
||||
then
|
||||
fail=true;
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $fail = true ]
|
||||
then
|
||||
echo
|
||||
echo "💀 The tests are logging, please capture logs. See:"
|
||||
echo " - https://hexdocs.pm/ex_unit/1.12/ExUnit.CaptureLog.html"
|
||||
echo " - https://hexdocs.pm/ex_unit/1.12/ExUnit.Case.html#module-known-tags"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
2
.github/workflows/elixir.yml
vendored
2
.github/workflows/elixir.yml
vendored
@ -71,7 +71,7 @@ jobs:
|
||||
- name: Check Credo Warnings
|
||||
run: mix credo diff --from-git-merge-base origin/master
|
||||
- name: Run tests
|
||||
run: mix test --include slow --max-failures 1 --warnings-as-errors
|
||||
run: mix test --include slow --max-failures 1 --warnings-as-errors | .github/bin/log-watch.sh
|
||||
- name: Check Dialyzer
|
||||
run: mix dialyzer
|
||||
env:
|
||||
|
Loading…
Reference in New Issue
Block a user