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

Sort the list of test classes. #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skington
Copy link
Contributor

It's currently returned in essentially random order, which is less than helpful. If you have a large number of test classes, it helps for similar tests (e.g. Foo::Create, Foo::Delete, Foo::Modify, Foo::Update) to be run at similar times, so you can spot that all your test failures are to do with Foo::*, and cancel a test run once you spot a pattern, rather than those class being interspersed higgledy-piggledy with other tests involving Bar, Baz,Bletch and so on.

I suspect that mro::get_isarev is internally grovelling through a Perl hash, in which case the supposedly-random order will in fact be the same every time for a given version of Perl, so it's not even a useful random order.

We're currently applying the equivalent of this patch at $WORK, via monkey-patching Test::Class because you can't actually override methods via inheritance. It would be nice for this to make the core module.

It's currently returned in essentially random order, which is less than helpful.
@karenetheridge
Copy link
Contributor

I suspect that mro::get_isarev is internally grovelling through a Perl hash, in which case the supposedly-random order will in fact be the same every time for a given version of Perl, so it's not even a useful random order.

Not true as of perl 5.18 - now hashes are truly randomized.

I see randomized tests as more of a feature than a liability -- it helps find unintended side effects of running tests.

This should instead be an option, with the default being the current (random) ordering.

@skington
Copy link
Contributor Author

skington commented May 7, 2014

Now that hash order is truly random in modern Perls, yes, it has some use. I'll look into the most idiomatic Test::Class way of making this an option.

@karenetheridge
Copy link
Contributor

BTW the caveats in #10 apply here too -- big feature changes are not likely to be accepted (at least, not by me).

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.

None yet

2 participants