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 (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/navidrome/navidrome/db"
|
"github.com/navidrome/navidrome/db"
|
||||||
@ -13,13 +14,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestScanner(t *testing.T) {
|
func TestScanner(t *testing.T) {
|
||||||
// Detect any goroutine leaks in the scanner code under test
|
// Only run goleak checks when not in CI environment
|
||||||
defer goleak.VerifyNone(t,
|
if os.Getenv("CI") == "" {
|
||||||
goleak.IgnoreTopFunction("github.com/onsi/ginkgo/v2/internal/interrupt_handler.(*InterruptHandler).registerForInterrupts.func2"),
|
// Detect any goroutine leaks in the scanner code under test
|
||||||
// The notify library creates internal goroutines for file watching that persist after Stop() is called.
|
defer goleak.VerifyNone(t,
|
||||||
// These are created by the plugins package tests and are expected behavior.
|
goleak.IgnoreTopFunction("github.com/onsi/ginkgo/v2/internal/interrupt_handler.(*InterruptHandler).registerForInterrupts.func2"),
|
||||||
goleak.IgnoreTopFunction("github.com/rjeczalik/notify.(*recursiveTree).dispatch"),
|
// 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)
|
tests.Init(t, true)
|
||||||
defer db.Close(context.Background())
|
defer db.Close(context.Background())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user