[ARVADOS-DEV] created: 8b3d7b73503b41c2b55a62674a25b1d5c4a141bf
git at public.curoverse.com
git at public.curoverse.com
Tue May 19 14:46:59 EDT 2015
at 8b3d7b73503b41c2b55a62674a25b1d5c4a141bf (commit)
commit 8b3d7b73503b41c2b55a62674a25b1d5c4a141bf
Author: Nico Cesar <nico at nicocesar.com>
Date: Tue May 19 14:44:18 2015 -0400
adding the creation of plot data that jenkins plot pluging will be able to read
refs #6061
diff --git a/jenkins/create-plot-data-from-log.sh b/jenkins/create-plot-data-from-log.sh
new file mode 100755
index 0000000..daf3ef8
--- /dev/null
+++ b/jenkins/create-plot-data-from-log.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+build=$1
+file=$2
+outputdir=$3
+
+usage() {
+ echo "./$0 build_number file_to_parse output_dir"
+ echo "this script will use the build output to generate *csv and *txt"
+ echo "for jenkins plugin plot https://github.com/jenkinsci/plot-plugin/"
+}
+
+if [ $# -ne 3 ]
+then
+ usage
+ exit 1
+fi
+
+if [ ! -e $file ]
+then
+ usage
+ echo "$file doesn't exists! exiting"
+ exit 2
+fi
+if [ ! -w $outputdir ]
+then
+ usage
+ echo "$outputdir isn't writeable! exiting"
+ exit 3
+fi
+
+#------------------------------
+## max lines that a test will output
+MAXLINES=1000
+
+## TODO: check $build and $file make sense
+
+for test in \
+ test_Collection_page_renders_name \
+ test_combine_selected_collections_into_new_collection \
+ test_combine_selected_collection_files_into_new_collection_active_foo_collection_in_aproject_true \
+ test_combine_selected_collection_files_into_new_collection_active_foo_file_false \
+ test_combine_selected_collection_files_into_new_collection_project_viewer_foo_collection_in_aproject_false \
+ test_combine_selected_collection_files_into_new_collection_project_viewer_foo_file_false
+do
+ zgrep -A$MAXLINES "^CollectionsTest: $test" $file | tail --lines=+3|grep -B$MAXLINES -E "^-*$" -m1 > $outputdir/$test-$build.txt
+ echo processing $outputdir/$test-$build.txt creating $outputdir/$test.csv
+ echo $(grep ^Completed $test-$build.txt | perl -n -e '/^Completed (.*) in [0-9]+ms.*$/;print "".++$line."-$1,";' | perl -p -e 's/,$//g'|tr " " "_" ) > $outputdir/$test.csv
+ echo $(grep ^Completed $test-$build.txt | perl -n -e '/^Completed.*in ([0-9]+)ms.*$/;print "$1,";' | perl -p -e 's/,$//g' ) >> $outputdir/$test.csv
+ #echo URL=https://ci.curoverse.com/view/job/arvados-api-server/ws/apps/workbench/log/$test-$build.txt/*view*/ >> $outputdir/$test.properties
+done
diff --git a/jenkins/run-tests.sh b/jenkins/run-tests.sh
index 8e58d67..375c4e0 100755
--- a/jenkins/run-tests.sh
+++ b/jenkins/run-tests.sh
@@ -185,10 +185,12 @@ sanity_checks() {
}
rotate_logfile() {
+ # i.e. rotate_logfile "$WORKSPACE/apps/workbench/log/" "test.log"
# $BUILD_NUMBER is set by Jenkins if this script is being called as part of a Jenkins run
if [[ -f "$1/$2" ]]; then
THEDATE=`date +%Y%m%d%H%M%S`
mv "$1/$2" "$1/$THEDATE-$BUILD_NUMBER-$2"
+ ./create-plot-data-from-log.sh $BUILD_NUMBER "$1/$THEDATE-$BUILD_NUMBER-$2" "$1"
gzip "$1/$THEDATE-$BUILD_NUMBER-$2"
fi
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list