Open hdatma opened 3 years ago
This is also https://bugs.gentoo.org/745969 and Francisco Blas Izquierdo Riera (klondike) figured out what's going wrong:
Between https://github.com/trusteddomainproject/OpenDKIM/blob/develop/libopendkim/tests/Makefile.am#L20 and https://github.com/trusteddomainproject/OpenDKIM/blob/develop/libopendkim/tests/Makefile.am#L51, a list of tests is constructed. The first one is the "setup" test, and the last one is the "cleanup" test. The build system expects the setup test to be run first, and the cleanup test to be run last; if not, you get test failures due to missing keys.
Since make -j<num> check
runs all of the test programs in parallel, the execution order is not guaranteed. Either the setup/cleanup tests should be forced to run first/last somehow, or something else should be done to ensure the availability of the keys. The solution here should also address https://github.com/trusteddomainproject/OpenDKIM/issues/113.
"somehow" is really annoying here. Other than reverting to the serial test harness with automake (warning, don't use, deprecated), etc, it seems that:
Yes, you can define a test as a prerequsite of another by declaring their logfiles as targets, eg: t-01.log: t-setup.log
The test harness has no specific support for "run first" or "run last" commands. It also doesn't have a "run this before your suite" command. There's only AM_TESTS_ENVIRONMENT, which runs on EVERY test.
There's not an easy (portable way) that I can find in GNU Automake to say "prerequisites for t-cleanup.log are, literally, the logfiles of every other test in check_programs" without defining it explicitly. Any attempts to build the list programatically throw autoconf warnings.
I could use AM_TESTS_ENVIRONMENT to run an init stage, ONLY IF the keys that are required are not present.
On the same note, the "cleanup" stage does nothing but delete the keys, which if we're going to move them out of /tmp, maybe we should just statically define them and call it good. The t-setup script really does nothing other than copying some key material somewhere, and t-cleanup just rm's it.
How about,
t-cleanup
entirely.t-setup
from TESTS
.CLEANFILES
so that make clean
does what t-cleanup
used to do.Step 3 is a little annoying, but not all of the tests require keys, so listing them will help it parallelize. And this should fix the /tmp
issue too.
Subsequent runs of "make check" return different results. Sometimes is passes all test, sometimes it fails the following.
The failures occur only when running parallel tests, for example, "make -j 12 check".