fix: prevent failure of collected data
This commit is contained in:
parent
6c2eb6eef3
commit
2968e5b61b
3 changed files with 206 additions and 10 deletions
21
pkg/collector/collector_test.go
Normal file
21
pkg/collector/collector_test.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package collector
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/traefik/traefik/v2/pkg/config/static"
|
||||
)
|
||||
|
||||
func Test_createBody(t *testing.T) {
|
||||
var staticConfiguration static.Configuration
|
||||
|
||||
err := hydrate(&staticConfiguration)
|
||||
require.NoError(t, err)
|
||||
|
||||
buffer, err := createBody(&staticConfiguration)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.NotEmpty(t, buffer)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue