-
Notifications
You must be signed in to change notification settings - Fork 552
CI: be explicit when skipping unit tests #2002
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 1996-2023 The Squid Software Foundation and contributors | ||
* | ||
* Squid software is distributed under GPLv2+ license and includes | ||
* contributions from numerous individuals and organizations. | ||
* Please see the COPYING and CONTRIBUTORS files for details. | ||
*/ | ||
|
||
/* | ||
* this is a dummy unit test file, meant to be used when a feature | ||
* is not available to be tested. | ||
*/ | ||
|
||
#include "squid.h" | ||
|
||
int | ||
main() { | ||
// use this magic return code to inform Automake cfgaux/test-driver | ||
// that a test was skipped | ||
return 77; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,23 +124,27 @@ squid-conf-tests: $(srcdir)/test-squid-conf.sh $(top_builddir)/src/squid.conf.de | |
exit 1; \ | ||
fi; \ | ||
done; \ | ||
failed=0; \ | ||
result=0; \ | ||
cfglist="$(top_builddir)/src/squid.conf.default $(srcdir)/squidconf/*.conf"; \ | ||
rm -f $@ || $(TRUE); \ | ||
for cfg in $$cfglist ; do \ | ||
$(srcdir)/test-squid-conf.sh $(top_builddir) $(sbindir) $$cfg || \ | ||
{ echo "FAIL: squid.conf test: $$cfg" | \ | ||
$(srcdir)/test-squid-conf.sh $(top_builddir) $(sbindir) $$cfg; result=$$?; \ | ||
case $$result in \ | ||
0) echo "PASS: squid.conf test: $$cfg" | \ | ||
sed s%$(top_builddir)/src/%% | \ | ||
sed s%$(srcdir)/squidconf/%% ; \ | ||
failed=1; break; \ | ||
}; \ | ||
if test "$$failed" -eq 0; then \ | ||
echo "PASS: squid.conf test: $$cfg" | \ | ||
continue ;; \ | ||
77) echo "SKIP: squid.conf test: $$cfg" | \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder what it would take to stop emulating automake test driver here and actually reuse it? Do you know? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
From what I know, each test would have to be its own script, not an iteration in a for loop in Makefile.am There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm... We are able to use cfgaux/test-driver to testHeaders. These Squid configuration tests feel rather similar:
With a few adjustments, we may even be able to move to something like this: - squid-conf-tests: ... $(srcdir)/squidconf/*
+ squid-conf-tests: ... $(EXTRA_DIST) The current squid-conf-tests script gets more complex with every modification, and we are writing it in a Makefile! Do you think a conversion to use cfgaux/test-driver for squid-conf-tests is worth trying? |
||
sed s%$(top_builddir)/src/%% | \ | ||
sed s%$(srcdir)/squidconf/%% ; \ | ||
else break; fi; \ | ||
continue ;; \ | ||
*) echo "FAIL: squid.conf test: $$cfg" | \ | ||
sed s%$(top_builddir)/src/%% | \ | ||
sed s%$(srcdir)/squidconf/%% ; \ | ||
exit $$result ;; \ | ||
esac; \ | ||
done; \ | ||
if test "$$failed" -eq 0; then cp $(TRUE) $@ ; else exit 1; fi | ||
if test "$$result" -eq 0; then cp $(TRUE) $@ ; else exit 1; fi | ||
|
||
CLEANFILES += \ | ||
squid-conf-tests \ | ||
|
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.
To avoid extra work/noise and/or inconsistencies, ./configure-level decisions should not be second-guessed during "make": If X was disabled by ./configure, it should disappear from "make" view (to the extent such disappearance is practical -- we have to obey automake rules, for example, of course). There are valid exceptions from this rule of thumb, but we should not add exceptional Makefile treatment for the three cases targeted by this PR, two cases arguably missed by this PR (
git grep skip-unless-autoconf-defines
), and tempt reviewers with a precedent to demand similar exceptional Makefile treatment for new test targets IMO.BTW, at least two of the cases targeted by this PR have preexisting problems. Solving those problems is likely to result in complete ENABLE_FS_UFS and ENABLE_FS_ROCK removal! I am not an authentication expert, but I suspect that ENABLE_AUTH should be removed as well. If you have time to work on those removals (one at a time, in the order they are mentioned in this paragraph), please do so.
If skip-unless-autoconf-defines code should print SKIP and return exit code 77, please consider making those changes (instead).
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.
Thanks for letting me know, adding these.
The text in that script reinforces my proposal to let SKIPped tests pass through in test-builds.sh: historically it was deemed important enough to notify the developer of tests being skipped that the script emits
WARNING
s when skipping tests..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.
The problem with skip-unless-autoconf-defines is that it doesn't use Automake's test harness, but it kind-of-sort-of emulates its output.
I'm extending it to emulate it more closely
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.
I still think we should not do the above.
I still support working on those skip-unless-autoconf-defines enhancements in this PR, but please do not ignore the last word in that sentence -- "instead".
Would you be willing to remove src/Makefile.am changes from this PR?
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.
I am happy to make including UFS and AUTH unconditional (in followup PRs, not a s a prerequisite to this).
Rock is at the moment a different story. It requires SHM, which is not currently working on MacOS, and I suppose it's never been tested on MinGW or Windows either, has it?
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.
Rock cache_dirs do not require shared memory. They do not use shared memory in non-SMP Squids.
SMP Squids use shared memory (with or without rock cache_dirs).