mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 18:16:26 +00:00
Add goleak in unit tests
This commit is contained in:
@ -4,9 +4,13 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
|
||||
func TestGetAll(t *testing.T) {
|
||||
// goleak is used to detect goroutine leaks
|
||||
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
||||
|
||||
providers := GetAll()
|
||||
// This number will have to (annoyingly) be updated
|
||||
// when adding new dns providers to the list
|
||||
@ -23,6 +27,9 @@ func TestGetAll(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGet(t *testing.T) {
|
||||
// goleak is used to detect goroutine leaks
|
||||
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
||||
|
||||
provider, err := Get("dns_duckdns")
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, "dns_duckdns", provider.Title)
|
||||
|
@ -5,9 +5,13 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
|
||||
func TestAcmeDNSProvider(t *testing.T) {
|
||||
// goleak is used to detect goroutine leaks
|
||||
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
||||
|
||||
provider := getDNSAcmeDNS()
|
||||
json, err := provider.GetJsonSchema()
|
||||
assert.Nil(t, err)
|
||||
|
@ -5,9 +5,13 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
|
||||
func TestAdProvider(t *testing.T) {
|
||||
// goleak is used to detect goroutine leaks
|
||||
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
||||
|
||||
provider := getDNSAd()
|
||||
provider.ConvertToUpdatable()
|
||||
json, err := provider.GetJsonSchema()
|
||||
|
@ -5,9 +5,13 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/goleak"
|
||||
)
|
||||
|
||||
func TestAliProvider(t *testing.T) {
|
||||
// goleak is used to detect goroutine leaks
|
||||
defer goleak.VerifyNone(t, goleak.IgnoreAnyFunction("database/sql.(*DB).connectionOpener"))
|
||||
|
||||
provider := getDNSAli()
|
||||
json, err := provider.GetJsonSchema()
|
||||
assert.Nil(t, err)
|
||||
|
Reference in New Issue
Block a user