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

Fix randomization seed #1329

Merged
merged 3 commits into from
Dec 10, 2018
Merged

Fix randomization seed #1329

merged 3 commits into from
Dec 10, 2018

Conversation

deivid-rodriguez
Copy link
Member

Summary

While debugging some apparently order dependent failures on my cucumber scenarios, I noticed that it's currently impossible to reproduce order dependent failures, because the seed cucumber says it has used is not the seed it has really used.

Details

My changes make sure that the seed that cucumber uses to randomize the scenarios is the same that cucumber informs in the UI, so the same scenario order can actually be reproduced in subsequent runs.

In order to test this, I needed to use some stuff from newer versions of aruba, so I upgraded the scenarios to use that first. Happy to extract that to a separate PR, of course.

Motivation and Context

This change makes it possible to reproduce order dependent failures when running scenarios in random order. Previously, it was not working.

How Has This Been Tested?

I added a test that runs cucumber in random order and with summary format, then runs cucumber again with the seed the previous command informed, and then checks that both commands give the same output (excluding runtime).

Screenshots (if appropriate):

Types of changes

  • Refactor (code change that does not change external functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I've added tests for my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@deivid-rodriguez
Copy link
Member Author

I splitted this PR into #1330, #1331 and #1332. Once those PRs are merged and reviewed, I'll rebase this one 👍.

If you don't explicitly pass a seed, cucumber would inform it has run
test with an incorrect seed, so it would be impossible to actually
reproduce a failing run.
@deivid-rodriguez
Copy link
Member Author

I rebased this PR that should be fully focused now and I added a changelog entry for it.

Copy link
Contributor

@luke-hill luke-hill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems legit. Don't know what the string output lookslike that you're regex sanitizing, but assume thats fine

@deivid-rodriguez
Copy link
Member Author

It's the information about the running time, something like "0m1.234s", which obviously might differ for both runs.

@deivid-rodriguez
Copy link
Member Author

Ok, going in! Thanks for your review @luke-hill!

@deivid-rodriguez deivid-rodriguez merged commit 2f5d7b8 into master Dec 10, 2018
@deivid-rodriguez deivid-rodriguez deleted the fix_randomization_seed branch December 10, 2018 11:41
@lock
Copy link

lock bot commented Dec 10, 2019

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 Dec 10, 2019
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

Successfully merging this pull request may close these issues.

3 participants