forked from NVIDIA/spark-rapids
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coverage-report
executable file
·50 lines (43 loc) · 1.74 KB
/
coverage-report
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#
# Copyright (c) 2020, 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.
# 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.
#
set -e
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/"}
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/"}
SOURCE_WITH_ARGS="--sourcefiles "$(echo $SOURCE_DIRS | sed -e 's/:/ --sourcefiles /g')
# Clean up the classes so we can build the report cleanly
rm -rf "$TMP_CLASS"
mkdir -p "$TMP_CLASS"
pushd "$TMP_CLASS"
jar xf "$DIST_JAR"
rm -rf com/nvidia/shaded/ org/openucx/
popd
if [ ! -f "$JDEST" ]; then
# get the jacoco jar
mvn dependency:get -DgroupId=org.jacoco -DartifactId=org.jacoco.cli -Dclassifier=nodeps -Dversion="$JVER" -Ddest="$JDEST"
fi
if [ "$#" != "0" ]; then
ARGS=$@
else
ARGS=$(find . -name "jacoco.exec" -printf "%p ")
fi
# run the report
java -jar "$JDEST" report --classfiles "$TMP_CLASS" --html "$HTML_LOC" $SOURCE_WITH_ARGS $ARGS
echo "The report is at file://"$(readlink -f "$HTML_LOC"/index.html)