-
Notifications
You must be signed in to change notification settings - Fork 538
Expand file tree
/
Copy pathfanout_test.go
More file actions
29 lines (22 loc) · 861 Bytes
/
fanout_test.go
File metadata and controls
29 lines (22 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package prometheus
import (
"testing"
"github.com/prometheus/client_golang/prometheus"
"github.com/grafana/alloy/internal/service/labelstore"
"github.com/prometheus/prometheus/storage"
"github.com/stretchr/testify/require"
)
func TestRollback(t *testing.T) {
ls := labelstore.New(nil, prometheus.DefaultRegisterer)
fanout := NewFanout([]storage.Appendable{NewFanout(nil, "1", prometheus.DefaultRegisterer, ls)}, "", prometheus.DefaultRegisterer, ls)
app := fanout.Appender(t.Context())
err := app.Rollback()
require.NoError(t, err)
}
func TestCommit(t *testing.T) {
ls := labelstore.New(nil, prometheus.DefaultRegisterer)
fanout := NewFanout([]storage.Appendable{NewFanout(nil, "1", prometheus.DefaultRegisterer, ls)}, "", prometheus.DefaultRegisterer, ls)
app := fanout.Appender(t.Context())
err := app.Commit()
require.NoError(t, err)
}