fix skipping bulk publish scenario
@@ -226,12 +226,15 @@ func ConformanceTests(t *testing.T, props map[string]string, ps pubsub.PubSub, c
// assumes that publish operation is run only once for publishing config.MessageCount number of events
// bulkpublish needs to be run after publish operation
if config.HasOperation("bulkpublish") {
- if bP, ok := ps.(pubsub.BulkPublisher); ok {
+ t.Run("bulkPublish", func(t *testing.T) {
+ bP, ok := ps.(pubsub.BulkPublisher)
+ if !ok {
+ t.Skipf("Bulk publish conformance skipped since component %s does not implement the required interface", config.ComponentName)
+ }
// only run the test if BulkPublish is implemented
// Some pubsub, like Kafka need to wait for Subscriber to be up before messages can be consumed.
// So, wait for some time here.
time.Sleep(config.WaitDurationToPublish)
- t.Run("bulkPublish", func(t *testing.T) {
req := pubsub.BulkPublishRequest{
PubsubName: config.PubsubName,
Topic: config.TestTopicName,
@@ -269,9 +272,6 @@ func ConformanceTests(t *testing.T, props map[string]string, ps pubsub.PubSub, c
// For scenarios on partial failures, those will be tested as part of certification tests if possible.
assert.NoError(t, err, "expected no error on bulk publishing on topic %s", config.TestTopicName)
})
- } else {
- t.Skipf("Bulk publish conformance skipped since component %s does not implement the required interface", config.ComponentName)
- }
}
// Verify read
