From 451475a7afc4e16456ec55b7d7a1c11af81da143 Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 30 Dec 2025 22:40:47 -0500 Subject: [PATCH] test(plugins): conditionally run goleak checks based on CI environment Signed-off-by: Deluan --- scanner/scanner_suite_test.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scanner/scanner_suite_test.go b/scanner/scanner_suite_test.go index 9b00a428a..6234ecebb 100644 --- a/scanner/scanner_suite_test.go +++ b/scanner/scanner_suite_test.go @@ -2,6 +2,7 @@ package scanner_test import ( "context" + "os" "testing" "github.com/navidrome/navidrome/db" @@ -13,13 +14,16 @@ import ( ) func TestScanner(t *testing.T) { - // Detect any goroutine leaks in the scanner code under test - defer goleak.VerifyNone(t, - goleak.IgnoreTopFunction("github.com/onsi/ginkgo/v2/internal/interrupt_handler.(*InterruptHandler).registerForInterrupts.func2"), - // The notify library creates internal goroutines for file watching that persist after Stop() is called. - // These are created by the plugins package tests and are expected behavior. - goleak.IgnoreTopFunction("github.com/rjeczalik/notify.(*recursiveTree).dispatch"), - ) + // Only run goleak checks when not in CI environment + if os.Getenv("CI") == "" { + // Detect any goroutine leaks in the scanner code under test + defer goleak.VerifyNone(t, + goleak.IgnoreTopFunction("github.com/onsi/ginkgo/v2/internal/interrupt_handler.(*InterruptHandler).registerForInterrupts.func2"), + // The notify library creates internal goroutines for file watching that persist after Stop() is called. + // These are created by the plugins package tests and are expected behavior. + goleak.IgnoreTopFunction("github.com/rjeczalik/notify.(*recursiveTree).dispatch"), + ) + } tests.Init(t, true) defer db.Close(context.Background())