Closed jonfinerty closed 7 years ago
@jonfinerty I am sorry to hear you experienced an issue using teamcity_formatter
and thank you for reporting it.
I was not aware you could tag an Examples
block, that's neat!
That said, to resolve this problem, I would need to have a full example of a failing case. I literally have to break into a debugging session to see how cucumber is modeling this situation in it's code. It is generally not clear from looking at the cucumber gem's source (at least for me).
Is a trivial breaking example something you might be able to put together in a gist (a full on tiny test suite example)?
In the interim, I think you could duplicate the test and tag the scenario outline itself:
@smoke
Scenario Outline: Testing a certain feature
...
@regression
Scenario Outline: Testing a certain feature
...
Your thoughts?
Thanks for the quick response, Sure I can get you that gist.
I think I've found the issue, in https://github.com/kevinrood/teamcity_formatter/blob/master/lib/team_city_formatter/formatter.rb#L106 theres the following line
cuke_example_rows = cuke_scenario_outline.examples_tables.first.example_rows
That first seems to be the culprit, as it just takes the first example table, when there could (although rarely :) ) be multiple tables. I've got the formatter hack-erly working by replacing that with:
cuke_example_rows = cuke_scenario_outline.examples_tables.map {|table| table.example_rows}.flatten
There certainly a more elegant way of fixing this, but hopefully this points you in the right direction.
@jonfinerty The only thing I can think of which would be more elegant is this (pretty close to what you have already :smile:):
cuke_example_rows = cuke_scenario_outline.examples_tables.map(&:example_rows).flatten
Would you like to open a pull request? My main concern would be to not break other non-multi examples
block cases. It may take me some time before I could get this change tested using a customer's test suite that is fairly comprehensive.
@jonfinerty and I see you did open a a pull request :smile:
😄 yup, but your ruby is better than mine. No problem about the wait, certainly wouldn't want to break the normal examples
Hi, sorry to nag. Have you had a chance to run this on a large test suite? We've run it internally, but we don't have the most comprehensive cucumber suites.
@kevinrood I see you've merged the fix, thanks! Could you push a new gem version so we can start using it and I can close this issue?
Done, thanks!
Hi,
I'm using a Scenario Outline with multiple examples tables, for different tags and when the formatter tries to process this I get the following crash:
Here's an example of the kind of thing I'm doing with the Scenario Outlines: