Fail the CI if tests emit log errors/warnings (#2694)

* Make CI fail if tests emit warning/error logs

* Swallow log output in GA test case
pull/2696/head r2023.02.21-57
Adam Rutkowski 4 years ago committed by GitHub
parent 3ed5e9d27d
commit ef894b0546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 | grep -P '\[(warning|error)\]' && echo "Log lines found. Capture log output in tests. Aborting." && exit 1 || exit 0
- name: Check Dialyzer
run: mix dialyzer
env:

@ -5,6 +5,8 @@ defmodule Plausible.Workers.ImportGoogleAnalyticsTest do
alias Plausible.Workers.ImportGoogleAnalytics
@moduletag capture_log: true
@imported_data %Plausible.Site.ImportedData{
start_date: Timex.today() |> Timex.shift(days: -7),
end_date: Timex.today(),

Loading…
Cancel
Save