File tree 1 file changed +10
-3
lines changed
src/ci/docker/x86_64-gnu-tools
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,17 @@ set -e
35
35
cat " $TOOLSTATE_FILE "
36
36
echo
37
37
38
+ # This function checks if a particular tool is *not* in status "test-pass".
39
+ check_tool_failed () {
40
+ grep -vq ' "' " $1 " ' ":"test-pass"' " $TOOLSTATE_FILE "
41
+ }
42
+
38
43
# This function checks that if a tool's submodule changed, the tool's state must improve
39
44
verify_status () {
40
45
echo " Verifying status of $1 ..."
41
46
if echo " $CHANGED_FILES " | grep -q " ^M[[:blank:]]$2 $" ; then
42
47
echo " This PR updated '$2 ', verifying if status is 'test-pass'..."
43
- if grep -vq ' " ' " $1 " ' ":"test-pass" ' " $TOOLSTATE_FILE " ; then
48
+ if check_tool_failed " $1 " ; then
44
49
echo
45
50
echo " ⚠️ We detected that this PR updated '$1 ', but its tests failed."
46
51
echo
@@ -55,14 +60,16 @@ verify_status() {
55
60
fi
56
61
}
57
62
58
- # deduplicates the submodule check and the assertion that on beta some tools MUST be passing
63
+ # deduplicates the submodule check and the assertion that on beta some tools MUST be passing.
64
+ # $1 should be "submodule_changed" to only check tools that got changed by this PR,
65
+ # or "beta_required" to check all tools that have $2 set to "beta".
59
66
check_dispatch () {
60
67
if [ " $1 " = submodule_changed ]; then
61
68
# ignore $2 (branch id)
62
69
verify_status $3 $4
63
70
elif [ " $2 " = beta ]; then
64
71
echo " Requiring test passing for $3 ..."
65
- if grep -q ' " ' " $3 " ' ":"\(test\|build\)-fail" ' " $TOOLSTATE_FILE " ; then
72
+ if check_tool_failed " $3 " ; then
66
73
exit 4
67
74
fi
68
75
fi
You can’t perform that action at this time.
0 commit comments