Documentation
¶
Overview ¶
Package drivertest provides a conformance test for implementations of driver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunConformanceTests ¶
func RunConformanceTests(t *testing.T, newHarness HarnessMaker, asTests []AsTest)
RunConformanceTests runs conformance tests for provider implementations of pubsub.
Types ¶
type AsTest ¶
type AsTest interface {
// Name should return a descriptive name for the test.
Name() string
// TopicCheck will be called to allow verifcation of Topic.As.
TopicCheck(t *pubsub.Topic) error
// SubscriptionCheck will be called to allow verification of Subscription.As.
SubscriptionCheck(s *pubsub.Subscription) error
}
AsTest represents a test of As functionality. The conformance test: 1. Calls TopicCheck. 2. Calls SubscriptionCheck.
type Harness ¶
type Harness interface {
// MakeTopic makes a driver.Topic for testing.
MakeTopic(ctx context.Context) (driver.Topic, error)
// MakeNonexistentTopic makes a driver.Topic referencing a topic that
// does not exist.
MakeNonexistentTopic(ctx context.Context) (driver.Topic, error)
// MakeSubscription makes a driver.Subscription subscribed to the given
// driver.Topic.
MakeSubscription(ctx context.Context, t driver.Topic) (driver.Subscription, error)
// MakeNonexistentSubscription makes a driver.Subscription referencing a
// subscription that does not exist.
MakeNonexistentSubscription(ctx context.Context) (driver.Subscription, error)
// Close closes resources used by the harness, but does not call Close
// on the Topics and Subscriptions generated by the Harness.
Close()
}
Harness descibes the functionality test harnesses must provide to run conformance tests.
Click to show internal directories.
Click to hide internal directories.