-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ocamltest+testsuite: by default, only keep test data on failure #9414
Conversation
(so shouldn't the title be "only keep test data for failing builds"?) |
Duh. Thanks! (cc also @dra27 who has weird testcases in mind that copy and generate data in interesting ways, and might have a different opinion on the right default.) |
I very much like the idea, thanks a lot, @gasche. Regarding the coding details:
|
I'm not convinced by the idea of parametrization. In particular I don't see any situation where you would want to keep data for skipped tests (especially as, a priori, skipped tests did not run, so there should not be any data worth keeping). I would propose to wait until we see a clear need for it before making the interface more complex. I will apply your renaming suggestions, expect that the variable will be |
And: Thanks for the reviews! |
Gabriel Scherer (2020/04/02 05:40 -0700):
I'm not convinced by the idea of parametrization. In particular I
don't see any situation where you would want to keep data for skipped
tests (especially as, a priori, skipped tests did not run, so there
should not be any data worth keeping).
You are assuming that the skipped test runs first, which may indeed be
the case rather often, but still not always. One may for instance
compile a program as the test and then run it. If that run results in a
skip, you'd want to be able to keep the program to reproduce.
I would propose to wait until
we see a clear need for it before doing the interface more complex.
That's fine with me.
I will apply your renaming suggestions, expect that the variable will
be `KEEP_TEST_DIR_ON_SUCCESS` (with an extra `_`) so that there is a
direct mapping from the ocamltest variable for
convenience/discoverability.
Fine with me, too.
Just in case I don't get a notification whn you push the commits, please
leave a note here when you feel ready for a new review.
Best wishes and thanks again!
|
One question I think (for @shindere and @dra27) is whether we want to use the same default on the CI machines -- drop test data on successes -- or whether in that setting it is better to, when we inspect the output of a failed CI run, have all the gibibytes available. If the latter, then we want to set KEEP_..._ON_SUCCESS in the CI scripts. |
It feels to me it would actually be very good also on the CI machines to
drop the directories for successful tests. I think keeping those for
failed tests is very much what we need and that this will be a big
relief for the disks of our CI machines, especially at Inria, especially
the windows ones.
|
The existing approach requires to set all ocamltest flags at once on recursive calls. This is very inconvenient if we want to set more than one flag -- we wish to support choosing both -promote and -keep-test-dir-on-success.
On my machine, running the whole testsuite generates 1.5Gio of test data. I have 11 workdirs for the OCaml repository (versions from 4.08 to trunk, plus several experimental workdirs); at any point in time there can be more than a dozen gibibytes of test data on my disk, and this is too much. I use the test data saved by ocamltest when a test fails, to diagnose the failure. I don't remember ever looking at the test data of a succesful test. The present patchset changes ocamltest to, by default, discard the test directory of succesful tests -- the test artefacts are kept only when there is a failure. If one wishes to preserve the test data of succesful tests, one should explicitly pass the -keep-test-dir-on-success flag. The testsuite/Makefile is then changed to pass this flag if the user set the KEEP_TEST_DIR_ON_SUCCESS variable to a non-empty value.
f8f897f
to
86066c8
Compare
I rebased the PR with the renamings. |
Thanks. Approved. Feel free to merge as soon as CI passes.
|
Merged, thanks! |
We have new warnings reported by "make", and I think this PR is responsible for it:
Please add "define if not defined" assignments in the right places:
This is also the right place to add a comment explaining when we expect those variables to be set on the "make" command-line. |
Guilty! (I don't think that we want to let users set the first variable, so I will just use |
The parentheses above reveal that I'm still not very knowledgeable about how Make works; I would like the variable to be empty when the user invokes |
Testing indicates that setting |
I went to the GNU make documentation and found out there is also |
I think if you define the variable in all cases, maybe with the empty
string, and use ?= you should be fine and getting what you are looking
for.
|
Report by Xavier Leroy: #9414 (comment)
Fixed in 7612a6d, thanks. |
On my machine, running the whole testsuite generates 1.5Gio of test
data. I have 11 workdirs for the OCaml repository (versions from 4.08
to trunk, plus several experimental workdirs); at any point in time
there can be more than a dozen gibibytes of test data on my disk, and
this is too much. (I found this when I ran into space storage issue
on my development machine and looked at the culprits.)
I use the test data saved by ocamltest when a test fails, to diagnose
the failure. I don't remember ever looking at the test data of
a succesful test.
The present patchset changes ocamltest to, by default, discard the
test data of succesful tests. If one wishes to preserve the test
data on a succesful test, one should explicitly pass the
-keep-data-on-success flag. The testsuite/Makefile is then changed
to pass this flag if the user set the KEEP_DATA_ON_SUCCESS variable
to a non-empty value.