Skip to content

Commit

Permalink
Adding crude html report support.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasnoble committed Oct 2, 2015
1 parent 7a94236 commit 4d97707
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ objs
python*_virtual_environment

# gcov coverage data
reports
coverage
*.gcno

Expand Down
4 changes: 4 additions & 0 deletions tools/jenkins/build_docker_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 14 additions & 0 deletions tools/jenkins/docker_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<html><head></head><body>' > index.html
find . -maxdepth 1 -mindepth 1 -type d | sort | while read d ; do
d=${d#*/}
n=${d//_/ }
echo "<a href='$d/index.html'>$n</a><br />" >> index.html
done
echo '</body></html>' >> index.html
cd ..

zip -r reports.zip reports
8 changes: 4 additions & 4 deletions tools/run_tests/run_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4d97707

Please sign in to comment.