reftest: add '.install' exhaustive test for all fields - #6956
Conversation
| ### OPAMYES=1 | ||
| ### # we neeed the precise tracking to have a sha in changes file instead of timestamp | ||
| ### OPAMPRECISETRACKING=1 | ||
| ### OPAMDEBUGSECTIONS="TRACK ACTION SYSTEM" |
There was a problem hiding this comment.
I'm not sure if it worth having the SYSTEM logging
There was a problem hiding this comment.
I think that we can indeed make it so that the cat.ml script provides the information we need, that would make the whole test shorter and easier to understand!
There was a problem hiding this comment.
I've removed the SYSTEM log, we don't necessarily need to see all the system access
| SYSTEM write ${BASEDIR}/OPAM/sw-misc/.opam-switch/build/pkg-misc.1/pkg-misc.install | ||
| [WARNING] Errors in ${BASEDIR}/OPAM/sw-misc/.opam-switch/build/pkg-misc.1/pkg-misc.install, some fields have been ignored: | ||
| - At ${BASEDIR}/OPAM/sw-misc/.opam-switch/build/pkg-misc.1/pkg-misc.install:1:8-1:20:: | ||
| expected abs-filename |
There was a problem hiding this comment.
Comment for issue : the error can be better here
| [ERROR] In ${BASEDIR}/OPAM/sw-man/.opam-switch/build/pkg-man.1/pkg-man.install: | ||
| Not_found |
There was a problem hiding this comment.
We should fail gracefully
NathanReb
left a comment
There was a problem hiding this comment.
The current logging level makes it quite hard to read the test. Are we testing something that's only shown in the logs or are the resulting install and/or errors enough?
Can't some of those tests be merged? E.g. the basic case turned into a single pkg which successfully install a file for each field?
| ### OPAMPRECISETRACKING=1 | ||
| ### OPAMDEBUGSECTIONS="TRACK ACTION SYSTEM" | ||
| ### # Printer of `changes` file and the installed file 'finstalled' in switch (or root) | ||
| ### <cat.ml> |
There was a problem hiding this comment.
Don't we have a way to write this small utility script separately and use it from the reftest? We could make it a dune executable and add an explicit dependency. That would make later modification or debug of the script easier. Would also ease the review/reading of the script itself.
There was a problem hiding this comment.
It might at least be worth a small comment for each function of the script!
There was a problem hiding this comment.
cat.ml is specific to this test, it can not be externalised. Some of its function could. Updated with comments
There was a problem hiding this comment.
I simplified cat.ml to avoid rewriting other utilities that we already have, like opam-cat
| "lib|pkg-lib|finstalled" {"F:a611026bf7b99362c57473c4e1ef30a0"} | ||
| ] | ||
| ==> ${BASEDIR}/OPAM/sw-lib/lib/pkg-lib/finstalled | ||
| ### OPAMDEBUG=-5 opam remove pkg-lib | grep -v LOCK |
There was a problem hiding this comment.
Is this is just a post test clean up? If so how about disabling the logs in the output to avoid polluting the test?
There was a problem hiding this comment.
It is not cleanup, it checks that the installed files are well removed
| ### OPAMYES=1 | ||
| ### # we neeed the precise tracking to have a sha in changes file instead of timestamp | ||
| ### OPAMPRECISETRACKING=1 | ||
| ### OPAMDEBUGSECTIONS="TRACK ACTION SYSTEM" |
There was a problem hiding this comment.
I think that we can indeed make it so that the cat.ml script provides the information we need, that would make the whole test shorter and easier to understand!
It was my first attempt, but special cases came quite quickly (for misc & man). Having a test case per field permit to see more specifically the changes if they are (on a given field), and helps on specific cases testing (imo). |
|
PR updated. There is a remaining issue with +x flag on windows i think |
d6367e4 to
3a49c44
Compare
|
Updated, main comment updated too |
| ACTION Removing the local metadata | ||
| Done. | ||
| ### opam-cat OPAM/sw-bin/.opam-switch/install/pkg-bin.changes | ||
| # OPAM/sw-bin/.opam-switch/install/pkg-bin.changes not found |
There was a problem hiding this comment.
On removal, the installed file is not removed. Issue #7021
| TRACK before install: 1 elements scanned in 0.000s | ||
| ACTION Installing pkg-libexec.1. | ||
|
|
||
| ACTION creating ${BASEDIR}/OPAM/sw-libexec/lib/pkg-libexec |
There was a problem hiding this comment.
There is also this failure on libexec field... issue #7022
3a49c44 to
d80b724
Compare
d80b724 to
6b34ec2
Compare
6b34ec2 to
6a1eeeb
Compare
#6938 add new field to
.installfiles, there was no exhaustive test.The tests are 3 files:
Note: the windows test highlights some bugs, issues will be opened