feat(bdd): add shared stream operations scenario for Go SDK#3063
feat(bdd): add shared stream operations scenario for Go SDK#3063ex172000 wants to merge 5 commits intoapache:masterfrom
Conversation
|
this is nice. once you add more feature files (tests), can you create issues for implementing them in other SDKs? |
|
Finally, another .feature file. 😭 |
Move step definitions from stream_operations_test.go to stream_operations.go (non-test file) and register the suite in suite_test.go, matching the pattern used by basic_messaging and leader_redirection. Update imports to use refactored Go SDK paths (client, client/tcp, contracts). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
66a0626 to
d9d8908
Compare
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #3063 +/- ##
============================================
+ Coverage 70.58% 71.20% +0.62%
Complexity 943 943
============================================
Files 1113 1136 +23
Lines 94590 98100 +3510
Branches 71787 75287 +3500
============================================
+ Hits 66770 69856 +3086
- Misses 25348 25538 +190
- Partials 2472 2706 +234
🚀 New features to boost your workflow:
|
apache#1986) Extend the shared basic_messaging.feature with stream update and delete steps, covering full CRUD lifecycle. Add matching step definitions in all 6 SDKs (Go, Python, Rust, Java, Node, C#). Add update_stream and delete_stream methods to the Python SDK (PyO3). Remove the separate stream_operations.feature and its Go-only implementation to avoid duplication. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use iggy::prelude::Identifier instead of iggy::identifier::Identifier and unwrap Option<StreamDetails> from get_stream. Add null assertion for stream.get() return value in Node step definition. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sure! My thought is to modify on the go so we don't have additional step. In this case, I enhanced the basic messaging to include CRUD for streams so all language can have it now |
Thanks for pointing out! I don't like either and modified! Please take another look :D |
| func (s basicMessagingSteps) thenStreamDeletedSuccessfully(ctx context.Context) error { | ||
| c := getBasicMessagingCtx(ctx) | ||
| if c.lastStreamID != nil { | ||
| return errors.New("stream ID should be nil after deletion") | ||
| } | ||
| return nil | ||
| } |
There was a problem hiding this comment.
I think it's better to call GetStream here to verify whether the stream is actually deleted.
| sc.Step(`I delete the stream`, s.whenDeleteStream) | ||
| sc.Step(`the stream should be deleted successfully`, s.thenStreamDeletedSuccessfully) |
There was a problem hiding this comment.
I recommend ^...$ for consistency. e.g. ^I delete the stream$
| 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)) | ||
| } |
There was a problem hiding this comment.
I’m not sure it’s worth cleaning this up. Even if we do want to, this approach isn’t ideal. We should probably provide a script that cleans up all resources instead (e.g., fetch all streams, topics, users, etc., and delete them), which would work across all scenarios and ensure everything is properly cleaned.
For example, if CreateStream(A) actually creates a stream B, but DeleteStream(A) only attempts to delete A, then who is responsible for deleting B?
Actually this is not part of code review LOL. I commented in Go SDK bdd. Would you mind to take a look at them? |
Which issue does this PR close?
Related to #1986
Rationale
Adopt the same pattern as other BDD
What changed?
Add a shared Gherkin feature file for stream CRUD operations and corresponding
godogstep definitions, beginning the migration of Go BDD tests from embedded Ginkgo scenarios to shared.featurefiles.Local Execution
prek --last-commitpassed)AI Usage