Skip to content

test(csharp): add leader_redirection scenario to BDD tests#2948

Open
yeyomontana wants to merge 19 commits intoapache:masterfrom
yeyomontana:feat/csharp-bdd-leader-redirection
Open

test(csharp): add leader_redirection scenario to BDD tests#2948
yeyomontana wants to merge 19 commits intoapache:masterfrom
yeyomontana:feat/csharp-bdd-leader-redirection

Conversation

@yeyomontana
Copy link
Contributor

@yeyomontana yeyomontana commented Mar 16, 2026

Summary

Add support for the leader_redirection BDD scenario in the C# SDK test suite.

Changes

  • add LeaderRedirectionSteps.cs with step definitions for the scenario
  • update the C# BDD test project wiring so the scenario is included
  • update test context and hooks required for the scenario

LLM usage: LLM tools were used to help inspect the repository and assist with debugging CI/compiler issues. The final changes were reviewed and verified manually before submission.

Notes

This adds the missing C# BDD scenario support to align coverage with the existing shared scenario set.

Closes #2628

@yeyomontana yeyomontana changed the title feat(csharp-bdd): add leader_redirection scenario support [csharp SDK] Implement leader_redirection scenario in BDD tests Mar 16, 2026
@yeyomontana yeyomontana force-pushed the feat/csharp-bdd-leader-redirection branch from 812b07f to b0f1f7e Compare March 16, 2026 16:25
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.80%. Comparing base (a1045c3) to head (8c3788e).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2948      +/-   ##
============================================
+ Coverage     70.36%   71.80%   +1.44%     
  Complexity      925      925              
============================================
  Files          1050     1113      +63     
  Lines         86942    92584    +5642     
  Branches      64492    70145    +5653     
============================================
+ Hits          61178    66484    +5306     
- Misses        23256    23535     +279     
- Partials       2508     2565      +57     
Flag Coverage Δ
csharp 67.45% <ø> (-0.19%) ⬇️
rust 72.52% <ø> (+1.92%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 93 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yeyomontana yeyomontana changed the title [csharp SDK] Implement leader_redirection scenario in BDD tests [csharp sdk] implement leader_redirection scenario in bdd tests Mar 16, 2026
@atharvalade
Copy link
Contributor

@yeyomontana this PR title is invalid, the CI won't pass. Can you rename the PR title from one of these options:

  • feat
  • fix
  • docs
  • style
  • refactor
  • perf
  • test
  • build
  • ci
  • chore
  • revert
  • repo
  • deps

Please look at other PRs for reference.

@yeyomontana yeyomontana changed the title [csharp sdk] implement leader_redirection scenario in bdd tests test (csharp-sdk): add leader_redirection scenario to BDD tests Mar 16, 2026
@lukaszzborek lukaszzborek changed the title test (csharp-sdk): add leader_redirection scenario to BDD tests test(csharp): add leader_redirection scenario to BDD tests Mar 16, 2026
@lukaszzborek
Copy link
Contributor

Hi, I see unrelated changes from rust file. Please remove it.
Also please answer questions about LLM usage which are in pr template

@yeyomontana
Copy link
Contributor Author

Thanks for the feedback, I removed the unrelated change so the PR now only contains the C# BDD files.

I’ve also answered the LLM usage question in the PR description.

@yeyomontana yeyomontana requested a review from hubcio March 17, 2026 12:14
Copy link
Contributor

@lukaszzborek lukaszzborek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yeyomontana I added some comments. I propose creating client test metadata where you can store information about the initial address or redirection.
You can also check what it looks like in other languages. Rust and Go have implemented that.

@yeyomontana
Copy link
Contributor Author

@lukaszzborek

Thanks for the detailed review — I’ve applied all the suggested changes:
• removed hardcoded node count and store it in context
• store nodeId/port mapping in context
• removed the manual wait (relying on docker compose)
• switched to per-client metadata for redirection checks
• merged duplicate step definitions

Let me know if anything still needs adjustment 👍

@lukaszzborek
Copy link
Contributor

@yeyomontana please make sure the code compiles and the tests pass. You should also do this locally.

@atharvalade
Copy link
Contributor

@lukaszzborek

Thanks for the detailed review — I’ve applied all the suggested changes: • removed hardcoded node count and store it in context • store nodeId/port mapping in context • removed the manual wait (relying on docker compose) • switched to per-client metadata for redirection checks • merged duplicate step definitions

Let me know if anything still needs adjustment 👍

@yeyomontana It'll be awesome if you could use the PR template for future PRs to maintain consistency. It'll be there when you open a new PR.

@yeyomontana
Copy link
Contributor Author

Applied the fix and pushed an update.

Verified locally:

  • dotnet restore
  • dotnet build (passes)
  • BDD tests compile successfully

Thank you for the feedback.

@yeyomontana
Copy link
Contributor Author

@lukaszzborek @hubcio

All requested changes have been addressed:

  • stored node configuration in context (removed hardcoded assertions)
  • removed unnecessary port waiting (Docker handles readiness)
  • added client metadata for initial address / redirection tracking
  • merged duplicated step definitions into a single step

CI is now passing locally and in GitHub.

Would appreciate a re-review when you have a moment.

Copy link
Contributor

@lukaszzborek lukaszzborek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yeyomontana I added 2 small cleanup comments. Also please update branch from master. After that i think we can merge it

@yeyomontana yeyomontana force-pushed the feat/csharp-bdd-leader-redirection branch 2 times, most recently from 1805447 to 2bbdb03 Compare March 20, 2026 10:36
@yeyomontana
Copy link
Contributor Author

@lukaszzborek removed the two unused pieces you pointed out. The branch is already up to date with master and ready for merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[csharp SDK] Implement leader_redirection scenario in BDD tests

4 participants