snapshot of https://github.com/centrifugal/centrifugo.git (master, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
31
internal/consuming/consuming_test.go
Normal file
31
internal/consuming/consuming_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
//go:build integration
|
||||
|
||||
package consuming
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/centrifugal/centrifugo/v6/internal/metrics"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
// Initialize metrics with a custom registry for tests to avoid conflicts
|
||||
registry := prometheus.NewRegistry()
|
||||
_ = metrics.Init(metrics.Config{
|
||||
Registerer: registry,
|
||||
})
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
func testCommon(registry prometheus.Registerer) *consumerCommon {
|
||||
return &consumerCommon{
|
||||
name: "test",
|
||||
nodeID: uuid.New().String(),
|
||||
log: log.With().Str("consumer", "test").Logger(),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user