Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/component/prometheus/fanout_test.go
4093 views
1
package prometheus
2
3
import (
4
"testing"
5
6
"github.com/prometheus/client_golang/prometheus"
7
8
"github.com/prometheus/prometheus/storage"
9
10
"context"
11
12
"github.com/stretchr/testify/require"
13
)
14
15
func TestRollback(t *testing.T) {
16
fanout := NewFanout([]storage.Appendable{NewFanout(nil, "1", prometheus.DefaultRegisterer)}, "", prometheus.DefaultRegisterer)
17
app := fanout.Appender(context.Background())
18
err := app.Rollback()
19
require.NoError(t, err)
20
}
21
22
func TestCommit(t *testing.T) {
23
fanout := NewFanout([]storage.Appendable{NewFanout(nil, "1", prometheus.DefaultRegisterer)}, "", prometheus.DefaultRegisterer)
24
app := fanout.Appender(context.Background())
25
err := app.Commit()
26
require.NoError(t, err)
27
}
28
29