ci: use grep and sed to extract and tar failing fuzzers logs

Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
This commit is contained in:
Alessandro Comodi 2022-02-09 10:41:16 +01:00
parent 7f52c45d27
commit 1db2cffd63
2 changed files with 5 additions and 11 deletions

View File

@ -62,7 +62,7 @@ echo "----------------------------------------"
# Run the fuzzers # Run the fuzzers
set -x +e set -x +e
tmp=`mktemp` tmp=$(mktemp)
script --return --flush --command "make -j $CORES MAX_VIVADO_PROCESS=$MAX_VIVADO_PROCESS db-${XRAY_SETTINGS}-all" $tmp script --return --flush --command "make -j $CORES MAX_VIVADO_PROCESS=$MAX_VIVADO_PROCESS db-${XRAY_SETTINGS}-all" $tmp
DATABASE_RET=$? DATABASE_RET=$?
set +x -e set +x -e
@ -70,7 +70,10 @@ echo "----------------------------------------"
if [[ $DATABASE_RET != 0 ]] ; then if [[ $DATABASE_RET != 0 ]] ; then
# Collect the Vivado logs into one tgz archive # Collect the Vivado logs into one tgz archive
echo "Packing failing test cases" echo "Packing failing test cases"
grep "recipe for target" $tmp | awk 'match($0,/recipe for target.*'\''(.*)\/run\..*ok'\''/,res) {print "fuzzers/" res[1]}' | xargs tar -zcf fuzzers/fails.tgz # Looking for the failing directories and packing them
# example of line from which the failing fuzzer directory gets extracted:
# - Makefile:87: recipe for target '000-db-init/000-init-db/run.xc7a100tfgg676-1.ok' failed --> fuzzers/000-db-init
grep -Po "recipe for target '\K(.*)(?=\/run\..*\.ok')" $tmp | sed -e 's/^/fuzzers\//' | xargs tar -zcf fuzzers/fails-${XRAY_SETTINGS}.tgz
echo "----------------------------------------" echo "----------------------------------------"
echo "A failure occurred during Database build." echo "A failure occurred during Database build."
echo "----------------------------------------" echo "----------------------------------------"

View File

@ -34,12 +34,3 @@ echo "Total Memory (GB): $MEM_GB"
export MEM_PER_RUN=8 export MEM_PER_RUN=8
export MAX_GRID_CPU=$(($MEM_GB/$MEM_PER_RUN)) export MAX_GRID_CPU=$(($MEM_GB/$MEM_PER_RUN))
export MAX_VIVADO_PROCESS=$(($MEM_GB/$MEM_PER_RUN)) export MAX_VIVADO_PROCESS=$(($MEM_GB/$MEM_PER_RUN))
echo
echo "========================================"
echo "Host files"
echo "----------------------------------------"
echo $PWD
echo "----------------------------------------"
find . | sort
echo "----------------------------------------"