diff options
author | jmkiley <jordan.kiley@mapbox.com> | 2019-02-28 16:32:39 -0800 |
---|---|---|
committer | jmkiley <jordan.kiley@mapbox.com> | 2019-03-11 12:54:48 -0700 |
commit | 2496df9ce76c79638a59e1cd446e13bfb5ba7f76 (patch) | |
tree | 0906fcdc4d0ecddd9dfc8794d8e9a52e1f3a5e4c | |
parent | ce5054d93eb82c57911ea11e72406567798e28f3 (diff) | |
download | qtlocation-mapboxgl-2496df9ce76c79638a59e1cd446e13bfb5ba7f76.tar.gz |
[ios] coverage.json
-rwxr-xr-x[-rw-r--r--] | platform/ios/scripts/code-coverage.sh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/platform/ios/scripts/code-coverage.sh b/platform/ios/scripts/code-coverage.sh index 27a8a06e59..c2f0b508d1 100644..100755 --- a/platform/ios/scripts/code-coverage.sh +++ b/platform/ios/scripts/code-coverage.sh @@ -2,18 +2,32 @@ set -e set -o pipefail +set -u # Get code coverage, then convert it to JSON. cov_result=build/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport xcrun xccov view $cov_result --json > output.json -# Access the overall line coverage for the dynamic build. +# +# Convert the line coverage for the dynamic target to a percentage. +# percentage=`node -e "console.log(require('./output.json').lineCoverage)"` - -# Convert the coverage from "0.x" format to a percentage. cov=$(printf "%.2f" $(echo "$percentage*100" | bc -l)) + +# +# Create a formatted JSON file with the current coverage. +# +cat <<EOF > coverage.JSON +{ "current-coverage" : $cov } +EOF echo $cov # Clean up files. rm -rf build/ios/ios/Logs/Test/*.xcresult/ -rm -f output.json
\ No newline at end of file +rm -f output.json + +# +# upload to AWS +# + +aws s3 cp coverage.json s3://mapbox-loading-dock/raw/ios-maps-metrics/ --acl public-read
\ No newline at end of file |