From 1db2cffd636dd7071b5afa6678ef217540e69328 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Wed, 9 Feb 2022 10:41:16 +0100 Subject: [PATCH] ci: use grep and sed to extract and tar failing fuzzers logs Signed-off-by: Alessandro Comodi --- .github/workflows/scripts/db.sh | 7 +++++-- .github/workflows/scripts/hostinfo.sh | 9 --------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/scripts/db.sh b/.github/workflows/scripts/db.sh index 084afb28..c66a6d95 100755 --- a/.github/workflows/scripts/db.sh +++ b/.github/workflows/scripts/db.sh @@ -62,7 +62,7 @@ echo "----------------------------------------" # Run the fuzzers 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 DATABASE_RET=$? set +x -e @@ -70,7 +70,10 @@ echo "----------------------------------------" if [[ $DATABASE_RET != 0 ]] ; then # Collect the Vivado logs into one tgz archive 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 "A failure occurred during Database build." echo "----------------------------------------" diff --git a/.github/workflows/scripts/hostinfo.sh b/.github/workflows/scripts/hostinfo.sh index 8e69c993..577577cb 100755 --- a/.github/workflows/scripts/hostinfo.sh +++ b/.github/workflows/scripts/hostinfo.sh @@ -34,12 +34,3 @@ echo "Total Memory (GB): $MEM_GB" export MEM_PER_RUN=8 export MAX_GRID_CPU=$(($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 "----------------------------------------"