Skip to content

Commit

Permalink
add xml report for codecov (#1966)
Browse files Browse the repository at this point in the history
* add xml report for codecov

Signed-off-by: Peixin Li <peixinl@nvidia.com>

* update copyright

Co-authored-by: Peixin Li <peixinl@nvidia.com>
  • Loading branch information
pxLi and pxLi authored Mar 18, 2021
1 parent 3572a9d commit aacd517
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

codecov:
max_report_age: off
7 changes: 5 additions & 2 deletions build/coverage-report
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

#
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@ JVER=${JACOCO_VERSION:-"0.8.5"}
JDEST=${JACOCO_DEST:-"./target/jacococli.jar"}
TMP_CLASS=${TEMP_CLASS_LOC:-"./target/jacoco_classes/"}
HTML_LOC=${HTML_LOCATION:="./target/jacoco-report/"}
XML_LOC=${XML_LOCATION:="${HTML_LOC}"}
DIST_JAR=${RAPIDS_DIST_JAR:-$(ls ./dist/target/rapids-4-spark_2.12-*.jar | grep -v test | xargs readlink -f)}
SOURCE_DIRS=${SOURCE_DIRS:-"./sql-plugin/src/main/scala/:./sql-plugin/src/main/java/:./shuffle-plugin/src/main/scala/"}

Expand All @@ -44,7 +45,9 @@ if [ "$#" != "0" ]; then
else
ARGS=$(find . -name "jacoco.exec" -printf "%p ")
fi

mkdir -p $XML_LOC
# run the report
java -jar "$JDEST" report --classfiles "$TMP_CLASS" --html "$HTML_LOC" $SOURCE_WITH_ARGS $ARGS
java -jar "$JDEST" report --classfiles "$TMP_CLASS" --html "$HTML_LOC" --xml "$XML_LOC/jacoco.xml" $SOURCE_WITH_ARGS $ARGS

echo "The report is at file://"$(readlink -f "$HTML_LOC"/index.html)

0 comments on commit aacd517

Please sign in to comment.