fix: expose scenario name in $test binding#2705
Open
Ayush-Patel-56 wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2705 +/- ##
=======================================
Coverage 67.70% 67.71%
=======================================
Files 149 149
Lines 5757 5758 +1
=======================================
+ Hits 3898 3899 +1
Misses 1599 1599
Partials 260 260 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1 task
9f54cbd to
6708f7a
Compare
Signed-off-by: Ayush Patel <ayushpatel2731@gmail.com>
Signed-off-by: Ayush Patel <ayushpatel2731@gmail.com>
6708f7a to
ba6e4bf
Compare
Member
|
Coming back to this, I wonder why we don't have a ScenarioInfo struct 🤔 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Scenario names were silently ignored at runtime - defining a
nameon a scenario had no effect beyond the YAML schema. This fix makes the name available as$test.ScenarioNameso it can be referenced in bindings, scripts, and expressions.Related issue
Fixes #2614
Proposed Changes
ScenarioName stringtoTestInfoinpkg/runner/info.goscenarioNameintosetupTestContextso it gets populated in the$testbindingChecklist
Further Comments
Before this fix,
$test.ScenarioNamewas always an empty string even whennamewas set on a scenario:{"Id":1,"ScenarioId":1,"ScenarioName":"","Metadata":{"name":"scenario-name-test"}}