- 
                Notifications
    You must be signed in to change notification settings 
- Fork 475
ci: add randomized test matrix for better test coverage #1415
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
Conversation
| Hi @vlsi, this looks interesting but I don't want PRs and normal master builds to behave randomly or have too many builds, with Groovy 4 we already got another bunch of builds. However, I could see this used in a nightly/weelkly scheduled build, where it is not slowing down normal usage and would still catch possible issues. | 
| 
 That is the reason I suggest using the randomized matrix. I am sure the randomizer is way better to keep the matrix organized, test feed back fast, etc, etc. | 
| 
 If I understand it correctly,it will produce a different combination each time. Currently, github only allows to re-run all jobs, so you would have a different set ob jobs for the re-run. The builds are not 100% stable, as we have some tests with tight timeouts, so as not to slow down the whole build, but this causes the occasional failure with the need to re-run. Furthermore, I think that the set of jobs for PRs should be the same as the ones run on master. So moving that randomness to scheduled jobs sound like a viable solution. | 
| 
 I also would prefer to have it that way due to the reasons Leonard mentioned. | 
| 
 Running different tests on "re-run" is completely fine, and it does not hurt. Approaches are like property-based testing and fuzzing create new tests every time you launch them, and that is considered to be a power of testing approach rather than a weakness. The more time you devote to fuzzing, the more bugs it finds. That is exactly the same with randomized CI: the more launches you have the more build variations you explore. I believe you are stuck with a wrong mindset like "tests must be exactly the same every time", and I am sure the requested "re-run must launch the same tests" adds nothing to the test coverage or robustness. Hey, if you absolutely want that every "re-run jobs" in GitHub UI to relaunch exactly the same set of jobs, then you can have it: use "workflow id" (or PR id or username or whatever) as a seed for the random, then the matrix builder would yield exactly the same results for a given PR. | 
| All in all, I have absolutely no need to persuade you. It is up to you how you test Spock, however, it was really sad that JMeter testing in  Of course, everybody makes mistakes, however, the most demotivating outcome for me is that you literally decline adding tests to the testing framework. I'm closing the PR as I see you are not interested in it. | 
| 
 @vlsi  When did I decline it? I just said that I don't think it is a good idea to have them on  | 
This enables significantly improve test coverage while still keeping test feedback fast and easy configuration.
For example, this matrix captures locale-dependent issues like #1414
Here's how the matrix looks in my fork: https://github.com/vlsi/spock/actions/runs/1702274076
The idea is that you declare test axis like
os,java,java_distribution,timezone,locale, etc, andmatrix.jsproduces several jobs for you.Note: I do not understand what
variant=2.5andvariant=3.0mean, and I do not understand why did you exclude{java: 17, variant: '2.5', os: 'ubuntu-latest'}.If the only reason to exclude
2.5 with java 17 on ubuntuwas performance, then you might remove that exclusion frommatrix.js.See https://github.com/vlsi/github-actions-random-matrix
If you want to test matrix changes locally, you can launch
node matrix.jsand it prints something like