From 4d97707751dd0912225e14ef469da762b62f6979 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 2 Oct 2015 23:52:38 +0200 Subject: Adding crude html report support. --- .gitignore | 1 + tools/jenkins/build_docker_and_run_tests.sh | 4 ++++ tools/jenkins/docker_run_tests.sh | 14 ++++++++++++++ tools/run_tests/run_node.sh | 8 ++++---- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8dc459ea27..18b42811b2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ objs python*_virtual_environment # gcov coverage data +reports coverage *.gcno diff --git a/tools/jenkins/build_docker_and_run_tests.sh b/tools/jenkins/build_docker_and_run_tests.sh index 9f97f39e75..2c562e992a 100755 --- a/tools/jenkins/build_docker_and_run_tests.sh +++ b/tools/jenkins/build_docker_and_run_tests.sh @@ -74,6 +74,10 @@ then docker cp "$DOCKER_CID:/var/local/git/grpc/$XML_REPORT" $git_root fi +docker cp "$DOCKER_CID:/var/local/git/grpc/reports.zip" $git_root || true +unzip $git_root/reports.zip -d $git_root || true +rm -f reports.zip + # remove the container, possibly killing it first docker rm -f $DOCKER_CID || true diff --git a/tools/jenkins/docker_run_tests.sh b/tools/jenkins/docker_run_tests.sh index 3595a95f5c..2e39bc6f51 100755 --- a/tools/jenkins/docker_run_tests.sh +++ b/tools/jenkins/docker_run_tests.sh @@ -42,4 +42,18 @@ git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc nvm use 0.12 rvm use ruby-2.1 +mkdir -p reports + $RUN_TESTS_COMMAND + +cd reports +echo '' > index.html +find . -maxdepth 1 -mindepth 1 -type d | sort | while read d ; do + d=${d#*/} + n=${d//_/ } + echo "$n
" >> index.html +done +echo '' >> index.html +cd .. + +zip -r reports.zip reports diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh index 1043b447db..e322ab1995 100755 --- a/tools/run_tests/run_node.sh +++ b/tools/run_tests/run_node.sh @@ -43,13 +43,13 @@ export LD_LIBRARY_PATH=$root/libs/$CONFIG if [ "$CONFIG" = "gcov" ] then - ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \ - --timeout 8000 + ./node_modules/.bin/istanbul cover --dir ../../reports/node_coverage \ + ./node_modules/.bin/_mocha -- --timeout 8000 cd build gcov Release/obj.target/grpc/ext/*.o lcov --base-directory . --directory . -c -o coverage.info - genhtml -o ../ext_coverage --num-spaces 2 -t 'Node gRPC test coverage' \ - coverage.info + genhtml -o ../../../reports/node_ext_coverage --num-spaces 2 \ + -t 'Node gRPC test coverage' coverage.info else ./node_modules/mocha/bin/mocha --timeout 8000 fi -- cgit v1.2.3