Skip to content

Add option to shuffle test files.#21

Open
floere wants to merge 3 commits intoleahneukirchen:masterfrom
floere:patch-1
Open

Add option to shuffle test files.#21
floere wants to merge 3 commits intoleahneukirchen:masterfrom
floere:patch-1

Conversation

@floere
Copy link

@floere floere commented Jan 20, 2014

This is an idea that I'd like to put forth:
Add "shuffle" option. This adds a -u/--shuffle option (default is "do not shuffle", as it is currently).

Reason:
I really do like the new -a option. However, I do believe - ymmv - that tests should be run in random order to detect setup/code loading issues.

Currently, I do have to use something akin to FileList["spec/#{dir}/*_spec.rb"].shuffle.join ' ' to make this happen, which negates the benefits of -a.

Always shuffling, adding a shuffle option (e.g. -u), or always shuffling on -a would be my wish-order.

I'd like to put this idea up for discussion. Thanks for considering it :)

This adds a -u/--shuffle option (default is "do not shuffle", as it is currently).
@alloy
Copy link
Contributor

alloy commented Jan 20, 2014

👍

This is something that comes up most often across platforms where the default FS order might be different, e.g. local OS X remote (TravisCI) Linux.

One thing I’d like to see added is printing the full command that you can copy-paste to easily reproduce the results locally.

@floere
Copy link
Author

floere commented Jan 20, 2014

I completely forgot to add that at least in case of shuffling, the file order used should be printed (thanks @alloy for the reminder). But perhaps let's discuss this PR first.

@alloy
Copy link
Contributor

alloy commented Jan 20, 2014

I think it’s an essential part of this UX feature and important to take into consideration when thinking about the usefulness of it.

@floere
Copy link
Author

floere commented Jul 9, 2014

Travis is failing because this is 1.9.3+ code only.

@mmzoo
Copy link

mmzoo commented Apr 14, 2015

Is there a chance this can get merged in or does Bacon support Ruby 1.8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants