MCPcopy Create free account
hub / github.com/google/go-cloud / mustDialRabbit

Function mustDialRabbit

pubsub/rabbitpubsub/rabbit_test.go:45–62  ·  view source on GitHub ↗
(t testing.TB)

Source from the content-addressed store, hash-verified

43var logOnce sync.Once
44
45func mustDialRabbit(t testing.TB) amqpConnection {
46 t.Helper()
47
48 if !setup.HasDockerTestEnvironment() {
49 logOnce.Do(func() {
50 t.Log("using the fake because the RabbitMQ server is not available")
51 })
52 return newFakeConnection()
53 }
54 conn, err := amqp.Dial(rabbitURL)
55 if err != nil {
56 t.Fatal(err)
57 }
58 logOnce.Do(func() {
59 t.Logf("using the RabbitMQ server at %s", rabbitURL)
60 })
61 return &connection{conn}
62}
63
64func TestConformance(t *testing.T) {
65 harnessMaker := func(_ context.Context, t *testing.T) (drivertest.Harness, error) {

Callers 5

TestConformanceFunction · 0.85
BenchmarkRabbitFunction · 0.85
TestUnroutableFunction · 0.85
TestOpenTopicFromURLFunction · 0.85

Calls 5

HasDockerTestEnvironmentFunction · 0.92
newFakeConnectionFunction · 0.85
DoMethod · 0.80
LogMethod · 0.65
DialMethod · 0.45

Tested by

no test coverage detected