Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cucumber2: incorrect selection of scenarios to execute #778

Closed
2 of 3 tasks
akostadinov opened this issue Dec 3, 2014 · 10 comments
Closed
2 of 3 tasks

cucumber2: incorrect selection of scenarios to execute #778

akostadinov opened this issue Dec 3, 2014 · 10 comments
Labels
🐛 bug Defect / Bug

Comments

@akostadinov
Copy link
Contributor

Hello, I'm running cucumber like:
cucumber example.feature:lineX example.feature:lineY

With cucumber 1.3 I see scenarios executed in the order specified once. With cucumber 2 beta3 I see that first it runs the scenario with lower line number first and then it runs the same two scenarios a second time.

The order of execution is a problem because we are using an external test management system to synchronize scenario execution across multiple runners. But it is not ideal for the purpose and when having scenarios in same order on all runners, there are duplicate runs. To avoid that we reorder scenarios randomly and collisions are unlikely. With cucumber reordering execution, this may not work well.
Executing scenarios multiple times just doesn't make sense to me.

There is one more thing that I'm not sure is a bug but is a difference between 1.3 and 2.x. When specifying a line number of a scenario step, then 1.3 would execute the whole scenario. With 2.0 nothing gets executed.

To summarize:

  • order of scenarios is not preserved
  • scenarios executed more than once
  • 2.x would not execute a scenario specified by the line number of a step from that scenario
@mattwynne mattwynne modified the milestone: 2.0 Dec 22, 2014
@mattwynne mattwynne added the 🐛 bug Defect / Bug label Dec 28, 2014
@mattwynne
Copy link
Member

Confirmed.

bundle exec cucumber features/docs/cli/run_specific_scenarios.feature:9:25

=> 2 scenarios (2 passed)

vs

bundle exec cucumber features/docs/cli/run_specific_scenarios.feature:9 features/docs/cli/run_specific_scenarios.feature:25

=> 4 scenarios (4 passed)

@jdks
Copy link
Contributor

jdks commented Dec 28, 2014

Hi @mattwynne I've made a naïve attempt to fix the duplication issue stated above. It may only be a partial solution to the overall problem so please let me know if any other improvements can be made.

@akostadinov
Copy link
Contributor Author

That may sound stupid but my gut feeling tells me, it would be more reliable to build @file_specs in the first place, instead of trying to correct it after the fact.

Additionally I see reordering of executed scenarios is happening even when selection is like this: features/3scenarios.feature:9:6

@brasmusson
Copy link
Contributor

@akostadinov I cannot reproduce "2.x would not execute a scenario specified by the line number of a step from that scenario".
All of
bundle exec cucumber features/docs/cli/run_specific_scenarios.feature:10
to
bundle exec cucumber features/docs/cli/run_specific_scenarios.feature:23
result in

1 scenario (1 passed)
4 steps (4 passed)

@mattwynne
Copy link
Member

@akostadinov thanks so much for reporting this, and all the other bugs you've raised.

I've closed the ticket, but if the problem of selecting a step still seems to be an issue for you, can you open a new ticket?

@akostadinov
Copy link
Contributor Author

As you can see, the bugs I've reported are happening when 2 or more scenarios from a file are specified. I can't understand why the issue has been closed? Was it fixed? 2 days ago it was not.

@mattwynne
Copy link
Member

@akostadinov as I understand it, there are two bugs reported in this ticket:

  1. selecting two scenarios from the same feature by mentioning the file twice caused the scenarios to be run multiple times
  2. specifying the line number of a step does not run the scenario

I think (1) has been fixed by a8050ee which is in the master branch, and will be released soon. Do you have the facility to test from the master branch?

@brasmusson has said he can't reproduce (2).

That's why I closed the ticket. Does that make sense? 😄

@akostadinov
Copy link
Contributor Author

Thanks, I understand better now. But the third one I reported - reordering of scenarios executed (see end of my original post) has not been addressed. Or I don't see how it would be. But I'll be able to test after the holidays.

@mattwynne
Copy link
Member

Oh sorry I didn't clearly understand about that one. OK. Can you create a separate ticket for that with a specific example? If I get a chance I'll test it myself too.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Defect / Bug
Projects
None yet
Development

No branches or pull requests

4 participants