File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/ci/docker/x86_64-gnu-tools Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,17 @@ set -e
3535cat " $TOOLSTATE_FILE "
3636echo
3737
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+
3843# This function checks that if a tool's submodule changed, the tool's state must improve
3944verify_status () {
4045 echo " Verifying status of $1 ..."
4146 if echo " $CHANGED_FILES " | grep -q " ^M[[:blank:]]$2 $" ; then
4247 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
4449 echo
4550 echo " ⚠️ We detected that this PR updated '$1 ', but its tests failed."
4651 echo
@@ -55,14 +60,16 @@ verify_status() {
5560 fi
5661}
5762
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".
5966check_dispatch () {
6067 if [ " $1 " = submodule_changed ]; then
6168 # ignore $2 (branch id)
6269 verify_status $3 $4
6370 elif [ " $2 " = beta ]; then
6471 echo " Requiring test passing for $3 ..."
65- if grep -q ' " ' " $3 " ' ":"\(test\|build\)-fail" ' " $TOOLSTATE_FILE " ; then
72+ if check_tool_failed " $3 " ; then
6673 exit 4
6774 fi
6875 fi
You can’t perform that action at this time.
0 commit comments