-
Notifications
You must be signed in to change notification settings - Fork 14
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teach dune
to focus on one particular test
#366
Conversation
Oh wow! 馃槷 Yes, I can definitely see this being useful - both for eliminating platform-specific logic and for enabling it across the two CI systems 馃槂 馃憤
|
I don鈥檛 understand how this works in that example, but that鈥檚 an idea. How useful do you find the feature to run all the tests and get a final count of the number of failures at the end? (I didn鈥檛 find how to get this without |
Add a dune `ci` alias to control what to build in CI; its meaning can be defined by setting the `DUNE_CI_ALIAS` environment variable, and defaults to `runtest` Add `ci1` and `ci2` aliases to split the test-suite into two parts (for slow runners such as Cygwin) Add a `focusedtest` alias that will repeat one test multiple times, using either `bash` or `cmd` to loop and using dune's `diff` action to fail as soon as one of the run failed
Simplify CI workflows now that dune configuration supports all the combinations (only one test or the full suite, on all platforms)
I rewrote that PR last week to take your comment into account. It is now providing:
The last commit on that branch shows how to focus on one test (and modify the repeat counts). |
(write-file hoped "") | ||
(write-file failed-runs "") | ||
(run cmd /q /c | ||
"for %G in (1,2,3,4, 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20) do (echo Starting %G-th run && focusedtest.exe -v || echo %G >> failed-runs)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit/OCD trigger warning: extra space after 4
in 1,2,3,4, 5,6,...
Cool! I think I follow 馃槄 With this, if we switch Multicoretests-CI to run What happens if one runs |
That鈥檚 its only use, at least as it stands. And as it is easy to override the environment variable only in Github CI, I have no other application in mind.
Exactly!
The standard |
That's a beautiful solution! 鉂わ笍 |
CI summary
None of these are caused by the changes of the current PR. |
This PR adds the possibility to use
dune
to focus on one particular test, in a similar way to what we do with github actions. This will make it easy to enable focus testing in our CI by usingdune build @@runtest ...
rather thandune runtest ...
.The capability was tested with CI on commit a247a5e50f (thanks for the OPAM workflows which caught early the missing
package
annotation! 馃憤).We could imagine using that same mechanism to run focused tests also in github actions:
bash
in the testing stack on Windows / Cygwin (I don鈥檛 know whether this could introduce noise or not); this would probably require setting some CI parameter to avoid double runs on Cygwin (which was patched in CI: Skip Cygwin part 2 when running only one test聽#357).While doing this, I wondered whether it would be useful to split the test suite into more aliases than the single
runtest
, for instance to separate some tests that are prone to sporadic failures 馃