-
Notifications
You must be signed in to change notification settings - Fork 432
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
Shuffle the test methods in the same class(for junit4) #5
base: master
Are you sure you want to change the base?
Conversation
git-svn-id: https://svn.apache.org/repos/asf/ant/core/tags/ANT_194@1591171 13f79535-47bb-0310-9956-ffa450edef68
git-svn-id: https://svn.apache.org/repos/asf/ant/core/tags/ANT_194@1591180 13f79535-47bb-0310-9956-ffa450edef68
Some pointers for you:
Whilst I've raised a few points above, I can see merit in the concept of what you're doing here and think there would be value in it being progressed. Thanks, |
* semi-pesudo randomized comparator to sort the Description instances. By supplying the same seed, the order is deterministic * Using reflection to invoke the comparator.apply method so that it won't break for junit 3 users * add shuffleTests switch to turn it on * add shuffleSeed switch to supply the seed
* semi-pesudo randomized comparator to sort the Description instances. By supplying the same seed, the order is deterministic * Using reflection to invoke the comparator.apply method so that it won't break for junit 3 users * add shuffleTests switch to turn it on * add shuffleSeed switch to supply the seed
Hello Michael, Except for "some tests that prove this feature and protect it in future changes", all other concerns should have been addressed. Please let me know how do you think of it now. I should be able to work out the tests during holiday break. Thanks, |
Don't sort if the test methods are specified
Your changes look reasonable from a quick scan of them, and I'm impressed with the speed you made them. I'll give it a more thorough review once you've got some tests in. |
I've add an antunit test. Please review. |
…ute are specified
Michael, Have you got a chance to review the code? Thanks, |
@changgengli sorry, I forgot about this and your change now doesn't merge (I think it just needs master pulled back on to your branch). If you're still interested in contributing this functionality then could you get the change back into a merge-able state and I'll give it another review for you? |
Hello,
This PR is to randomize the excution order the junit test method in the same class. I came to this idea during the work we are upgrading from java 6 to java 8. A lot of test cases were broken after upgrade because those tests are relying on the execution order which is changed after upgrade.
This is actually just a hack for several hours. I can rework on it after I get more suggestion and more understanding to ant(eg. have a parameter to turn it off). But first, would this be valuable for others?
Thanks,
Changgeng