aboutsummaryrefslogtreecommitdiffstats
path: root/extras/hs-test/script/compress.sh
diff options
context:
space:
mode:
authorAdrian Villin <avillin@cisco.com>2024-05-10 04:19:35 -0400
committerAdrian Villin <avillin@cisco.com>2024-05-17 16:47:00 +0000
commit688ac5ae5513e5ed45be5cc4376bb4c1dd51258b (patch)
treec089c9af30b1d5a551d5fdc55d122e198f309c66 /extras/hs-test/script/compress.sh
parent595d8cb6689a2c6f6f4444125127270b2e10b380 (diff)
hs-test: fixed timed out tests passing in the CI
Type: test Change-Id: Id05ea56bc5dfd80d42b8600cf11e763e25420bd0 Signed-off-by: Adrian Villin <avillin@cisco.com>
Diffstat (limited to 'extras/hs-test/script/compress.sh')
-rw-r--r--extras/hs-test/script/compress.sh53
1 files changed, 26 insertions, 27 deletions
diff --git a/extras/hs-test/script/compress.sh b/extras/hs-test/script/compress.sh
index 92a2fbd6789..1f0205c1efb 100644
--- a/extras/hs-test/script/compress.sh
+++ b/extras/hs-test/script/compress.sh
@@ -1,34 +1,33 @@
#!/usr/bin/env bash
-if [ "${COMPRESS_FAILED_TEST_LOGS}" == "yes" -a -s "${HS_SUMMARY}/failed-summary.log" ]
+# if failed-summary.log is not empty, exit status = 1
+if [ -s "${HS_ROOT}/summary/failed-summary.log" ]
then
- echo -n "Copying docker logs..."
- dirs=$(jq -r '.[0] | .SpecReports[] | select(.State == "failed") | .LeafNodeText' ${HS_SUMMARY}/report.json)
- for dirName in $dirs; do
- logDir=/tmp/hs-test/$dirName
- if [ -d "$logDir" ]; then
- mkdir -p $WORKSPACE/archives/summary
- cp -r $logDir $WORKSPACE/archives/summary/
- fi
- done
- echo "Done."
-
- if [ -n "$WORKSPACE" ]
+ if [ -n "${WORKSPACE}" ]
then
- echo -n "Copying failed test logs into build log archive directory ($WORKSPACE/archives)... "
- mkdir -p $WORKSPACE/archives/summary
- cp -a ${HS_SUMMARY}/* $WORKSPACE/archives/summary
- echo "Done."
- fi
+ echo -n "Copying docker logs..."
+ dirs=$(jq -r '.[0] | .SpecReports[] | select(.State == "failed") | .LeafNodeText' ${HS_ROOT}/summary/report.json)
+ for dirName in $dirs; do
+ logDir=/tmp/hs-test/$dirName
+ if [ -d "$logDir" ]; then
+ mkdir -p ${WORKSPACE}/archives/summary
+ cp -r $logDir ${WORKSPACE}/archives/summary/
+ fi
+ done
+ echo "Done."
- echo -n "Compressing files in $WORKSPACE/archives from test runs... "
- cd $WORKSPACE/archives
- find . -type f \( -name "*.json" -o -name "*.log" \) -exec gzip {} \;
- echo "Done."
+ echo -n "Copying failed test logs into build log archive directory (${WORKSPACE}/archives)... "
+ mkdir -p ${WORKSPACE}/archives/summary
+ cp -a ${HS_ROOT}/summary/* ${WORKSPACE}/archives/summary
+ echo "Done."
-else
- echo "Not compressing files in temporary directories from test runs."
- exit 0
-fi
+ echo -n "Compressing files in ${WORKSPACE}/archives from test runs... "
+ cd ${WORKSPACE}/archives
+ find . -type f \( -name "*.json" -o -name "*.log" \) -exec gzip {} \;
+ echo "Done."
-exit 1 \ No newline at end of file
+ else
+ echo "Not compressing files in temporary directories from test runs."
+ fi
+ exit 1
+fi