You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
690 B
32 lines
690 B
1 year ago
|
package sqliteexporter
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"github.com/stretchr/testify/require"
|
||
|
"go.opentelemetry.io/collector/component/componenttest"
|
||
|
"go.opentelemetry.io/collector/exporter/exportertest"
|
||
|
)
|
||
|
|
||
|
func TestCreateDefaultConfig(t *testing.T) {
|
||
|
cfg := createDefaultConfig()
|
||
|
assert.NotNil(t, cfg, "failed to create default config")
|
||
|
assert.NoError(t, componenttest.CheckConfigStruct(cfg))
|
||
|
}
|
||
|
|
||
|
func Test_createTracesExporter(t *testing.T) {
|
||
|
cfg := &Config{
|
||
|
Path: "./traces.db",
|
||
|
}
|
||
|
|
||
|
exp, err := createTracesExporter(
|
||
|
context.Background(),
|
||
|
exportertest.NewNopCreateSettings(),
|
||
|
cfg,
|
||
|
)
|
||
|
assert.NoError(t, err)
|
||
|
require.NotNil(t, exp)
|
||
|
}
|