mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
test(plugins): conditionally run goleak checks based on CI environment
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
dc5100e56a
commit
451475a7af
@ -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())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user