-
Notifications
You must be signed in to change notification settings - Fork 541
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
CI: be explicit when skipping unit tests #2002
Open
kinkie
wants to merge
4
commits into
squid-cache:master
Choose a base branch
from
kinkie:explicitly-skip-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
||
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 \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?