Skip to content

Conversation

@chengxilo
Copy link
Contributor

@chengxilo chengxilo commented Jul 30, 2025

🤔 What's changed?

It checks the step handler params while registering the steps.

⚡️ What's your motivation?

There is a FIXME tag in test_context.go file and I think I can fix it.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)
  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

I think we should have different error message when step registering/run because the context.Context param is in a wrong place. So probably it would be a good idea to fix it in another pr, wondering whether I should fix it in a new pr.

for example:
when there is a handler like this:

func nokInvalidParamCtxNotFirst(_ int, _ context.Context){}

Maybe we can panic with

fmt.Sprintf("%s: the data type of parameter %d context.Context should be the first param", models.ErrUnsupportedParameterType, i)

📋 Checklist:


This text was originally generated from a template, then edited by hand. You can modify the template here.

@codecov
Copy link

codecov bot commented Jul 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.82%. Comparing base (153db4e) to head (2e40dfc).
⚠️ Report is 39 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #701      +/-   ##
==========================================
- Coverage   83.21%   77.82%   -5.39%     
==========================================
  Files          28       41      +13     
  Lines        3413     4153     +740     
==========================================
+ Hits         2840     3232     +392     
- Misses        458      798     +340     
- Partials      115      123       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chengxilo
Copy link
Contributor Author

ready to be merged.

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.

1 participant