Open wgwz opened 2 years ago
Providing the location of the scenario within the feature file might be nice and not something we would implement within regen ledger but rather within https://github.com/regen-network/gocuke.
That being said, this seems a bit redundant of Error Trace
and Test
:
Error Trace: msg_bridge_receive_test.go:60
The go test file and the line on which the error was thrown msg_bridge_receive_test.go:60
.
Test: TestMsgBridgeReceive/MsgBridgeReceive/an_error_is_returned_if_class_id_is_not_formatted
The go test that runs the scenarios in the feature file TestMsgBridgeReceive
, the feature name MsgBridgeReceive
defined in the feature file, and the scenario: an_error_is_returned_if_class_id_is_not_formatted
.
I'm going to transfer this issue to the gocuke repository, which is where it would need to be addressed.
I feel it makes getting to the feature file under test just a bit easier but that said I can see how you can craft the search differently using the feature name.
While the scenario is listed, the fact that it has underscores makes it not something you can copy and paste into a search to get to the scenario in the feature file (which has spaces and not underscores)
It's a bit hard to retrieve the exact file and line number given the current way that gherkin is transformed into their internal pickle representation. Not impossible, but hard.
What would be pretty easy is outputting literal step text as steps as executed. Would that help?
Thanks for looking at this! Yup, I think that would satisfy the requirement of wanting some specific text to search for, that brings me directly to scenario under test when there is a failure :-)
Summary
This issue is a proposal to add context to test failure output for feature files, i.e. filename and line no. of the failed scenario.
Problem Definition
This would improve the dev UX while debugging failed tests. Knowing the failed test you could more easily search for the file, and find the scenario you need to debug. I'm not sure if this is even possible, it is just an idea.
Proposal
Output at present:
Example Desired output:
Note the added
Location
wherex/ecocredit/core/features/msg_bridge_receive.feature:59
leads to:For Admin Use