From f99c335a029ad6b3ce09486a12da9e666a710803 Mon Sep 17 00:00:00 2001 From: mbeierl Date: Fri, 24 Feb 2017 14:29:08 -0500 Subject: Fixing final report Makes the report readable instead of JSON escaped and dumps it to the Jenkins daily when done. Change-Id: Ic3788672b185461369e2c41221ae36fc4b45436b Signed-off-by: mbeierl --- ci/daily.sh | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'ci') diff --git a/ci/daily.sh b/ci/daily.sh index 1e01cb8..e12964d 100755 --- a/ci/daily.sh +++ b/ci/daily.sh @@ -101,24 +101,35 @@ export TEST_CASE=snia_steady_state JOB=`$WORKSPACE/ci/start_job.sh \ | awk '/job_id/ {print $2}' | sed 's/"//g'` -JOB_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \ - | awk '/Status/ {print $2}' | cut -d\" -f2` +curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \ + -o $WORKSPACE/ci/job/status.json + +JOB_STATUS=`cat $WORKSPACE/ci/job/status.json | awk '/Status/ {print $2}' | cut -d\" -f2` while [ "$JOB_STATUS" != "Completed" ] do - sleep 60 - curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" - JOB_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \ - | awk '/Status/ {print $2}' | cut -d\" -f2` + sleep 600 + mv $WORKSPACE/ci/job/status.json $WORKSPACE/ci/job/old-status.json + curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \ + -o $WORKSPACE/ci/job/status.json + JOB_STATUS=`cat $WORKSPACE/ci/job/status.json | awk '/Status/ {print $2}' | cut -d\" -f2` + diff $WORKSPACE/ci/job/status.json $WORKSPACE/ci/job/old-status.json >/dev/null + if [ $? -eq 1 ] + then + cat $WORKSPACE/ci/job/status.json + fi done -HREF=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \ - | awk '/TestResultURL/ {print $2}' | cut -d\" -f2 | cut -d/ -f4-` - echo "Deleting stack for cleanup" -curl -X DELETE --header 'Accept: application/json' 'http://127.0.0.1:5000/api/v1.0/configurations' +curl -s -X DELETE --header 'Accept: application/json' 'http://127.0.0.1:5000/api/v1.0/configurations' sudo chmod 777 -R $WORKSPACE/ci/job/carbon -echo "Results published to: http://testresults.opnfv.org/test/$HREF" +curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=metadata" \ + -o $WORKSPACE/ci/job/report.json + +echo ========================================================================== +echo Final report +echo ========================================================================== +cat $WORKSPACE/ci/job/report.json exit 0 -- cgit 1.2.3-korg