From 17dceec4f7fc1640673121a20804fbff5502673f Mon Sep 17 00:00:00 2001 From: Kevin Adametz Date: Tue, 6 Oct 2026 13:00:50 +0000 Subject: [PATCH] =?UTF-8?q?tests:=20Testsuite=20meldet=20nicht=20mehr=20an?= =?UTF-8?q?=20GlitchTip=20=E2=80=94=20Sentry-DSNs=20in=20phpunit.xml=20gel?= =?UTF-8?q?eert,=20W=C3=A4chtertest;=20Produktions-Logs=20unter=20dev/=20i?= =?UTF-8?q?gnoriert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seit der lokalen DSN landeten absichtlich provozierte Fehler aus den Tests („Queue weg“, „Datenbank nicht erreichbar“, SQLite „no such table“, fehlende Rolle `customer`, Wasserstandsmarke) als Issues in GlitchTip. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 3 +++ phpunit.xml | 7 +++++++ tests/Feature/Monitoring/ErrorReportingTest.php | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index b1e6ec0e..503ac61b 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,6 @@ config/files/ # Doku lebt im Obsidian-Vault (iCloud), per Devcontainer nach docs/ eingebunden # — nicht im Repository (Audit Q-05, entschieden 05.10.2026). /docs/ + +# Produktions-Logs zur Auswertung (können personenbezogene Daten enthalten) +/dev/**/*.log diff --git a/phpunit.xml b/phpunit.xml index 1ca5f122..21cdf420 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -34,6 +34,13 @@ + + + + + + + diff --git a/tests/Feature/Monitoring/ErrorReportingTest.php b/tests/Feature/Monitoring/ErrorReportingTest.php index 3a9c87e1..67f546c3 100644 --- a/tests/Feature/Monitoring/ErrorReportingTest.php +++ b/tests/Feature/Monitoring/ErrorReportingTest.php @@ -5,6 +5,7 @@ use App\Support\Monitoring\ErrorReportScrubber; use Illuminate\Support\Facades\Route; use Sentry\Event; use Sentry\ExceptionDataBag; +use Sentry\SentrySdk; use Tests\Support\FakeGlitchTip; /** @@ -75,3 +76,11 @@ test('messages and exception values lose e-mail addresses', function () { ->and($scrubbed?->getExceptions()[0]->getValue())->toBe('Duplicate entry \'[email]\'') ->and($scrubbed?->getUser())->toBeNull(); }); + +test('the test suite never reports to the real glitchtip', function () { + // Ohne diese Absicherung landeten absichtlich provozierte Fehler + // („Queue weg“, „Datenbank nicht erreichbar“) als Issues in GlitchTip. + expect(config('sentry.dsn'))->toBeEmpty() + ->and(config('monitoring.browser.dsn'))->toBeEmpty() + ->and(SentrySdk::getCurrentHub()->getClient()?->getOptions()->getDsn())->toBeNull(); +});