File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -164,16 +164,18 @@ jobs:
164164 SQLALCHEMY_WARN_20 : 1
165165 continue-on-error : true
166166 run : |
167+ LOGFILE=output.log
167168 EXTRA_MSG=""
168- RESULT=$(pytest --color=yes -vv tests/*_test.py tests/test_*.py -m "strict_endpoints_test")
169- if [ $? -ne 0 ]; then # if test failed
170- while read -r FAIL; do
169+ ERR_COUNT=0
170+ pytest -vv tests/*_test.py tests/test_*.py -m "strict_endpoints_test" > $LOGFILE 2>&1 || \
171+ while read FAIL; do
171172 ANALYSIS=`echo ${FAIL##*strict\[} | cut -d "]" -f1` # get analysis name from pattern "strict[<ANALYSIS>]"
172- REASON=`echo ${FAIL#* - }` # get fail reason after " -"
173+ ERR_COUNT=$((ERR_COUNT+1))
174+ REASON=`grep "^E " $LOGFILE | head -n $ERR_COUNT | tail -n 1` # get fail reason
175+ REASON=${REASON:8} # remove prefix
173176 EXTRA_MSG="$EXTRA_MSG::warning ::Analyses endpoint '$ANALYSIS' was not available: $REASON\n"
174- done <<< `echo $RESULT | grep "FAILED.*\[" | grep -v "%"` # get summary lines with failing tests, ignore progress lines
175- fi
176- echo "$RESULT"
177+ done <<< `grep "FAILED.*\[" $LOGFILE | grep -v "%"` # get summary lines with failing tests, ignore progress lines
178+ cat $LOGFILE
177179 echo -n $EXTRA_MSG # flag warning to GitHub, remove trailing new lines
178180 - name : Setup Sauce Connect
179181 uses : saucelabs/sauce-connect-action@v3.0.0
You can’t perform that action at this time.
0 commit comments