chengxilo commented on code in PR #3063:
URL: https://github.com/apache/iggy/pull/3063#discussion_r3034356863
##########
bdd/go/tests/basic_messaging.go:
##########
@@ -322,10 +363,20 @@ func initBasicMessagingScenario(sc
*godog.ScenarioContext) {
sc.Step(`the topic should be created successfully`,
s.thenTopicCreatedSuccessfully)
sc.Step(`^the topic should have name "([^"]*)"$`, s.thenTopicHasName)
sc.Step(`^the topic should have (\d+) partitions$`,
s.thenTopicsHasPartitions)
+ sc.Step(`^I update the stream name to "([^"]*)"$`,
s.whenUpdateStreamName)
+ sc.Step(`^the stream name should be updated to "([^"]*)"$`,
s.thenStreamNameUpdated)
+ sc.Step(`I delete the stream`, s.whenDeleteStream)
+ sc.Step(`the stream should be deleted successfully`,
s.thenStreamDeletedSuccessfully)
sc.After(func(ctx context.Context, sc *godog.Scenario, scErr error)
(context.Context, error) {
c := getBasicMessagingCtx(ctx)
- if err := c.client.Close(); err != nil {
- scErr = errors.Join(scErr, fmt.Errorf("error closing
client: %w", err))
+ if c.client != nil && c.lastStreamID != nil {
+ streamIdentifier, _ :=
iggcon.NewIdentifier(*c.lastStreamID)
+ _ = c.client.DeleteStream(streamIdentifier)
+ }
+ if c.client != nil {
+ if err := c.client.Close(); err != nil {
+ scErr = errors.Join(scErr, fmt.Errorf("error
closing client: %w", err))
+ }
Review Comment:
I’m not sure it’s worth it, since we use different Dockerfiles for different
scenarios. Even if we want to clean things up, this isn’t a great approach. We
should probably provide a script to clean up all the resources instead. (Get
all streams, get all topic, get all users, etc and delete them all, which will
works for every scenario)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]