diff options
author | jmkiley <jordan.kiley@mapbox.com> | 2019-03-07 14:55:08 -0800 |
---|---|---|
committer | jmkiley <jordan.kiley@mapbox.com> | 2019-03-11 12:54:51 -0700 |
commit | 2aa49f9fc1fdda968ae71f15ddfd9c7729b45f92 (patch) | |
tree | 5c163ae2172941c0c443731809344f485ef002a9 /platform/ios/scripts/code-coverage.sh | |
parent | bba0d3537bad7cbc5a88d7291ba979e21bf64d29 (diff) | |
download | qtlocation-mapboxgl-2aa49f9fc1fdda968ae71f15ddfd9c7729b45f92.tar.gz |
[ios] Update build script, breakout upload script
Diffstat (limited to 'platform/ios/scripts/code-coverage.sh')
-rwxr-xr-x | platform/ios/scripts/code-coverage.sh | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/platform/ios/scripts/code-coverage.sh b/platform/ios/scripts/code-coverage.sh index d4c535ae62..ede97bbbf2 100755 --- a/platform/ios/scripts/code-coverage.sh +++ b/platform/ios/scripts/code-coverage.sh @@ -3,17 +3,19 @@ set -e set -o pipefail +# # Get code coverage report, then convert it to JSON. # The coverage reports end up in different locations based on whether coverage # is generated via CI or locally. # + cov_result=""; if [ -f build/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport ]; then cov_result=build/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport elif [ -f build/ios/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport ]; then cov_result=build/ios/ios/Logs/Test/*.xcresult/*_Test/*.xccovreport else - echo "Coverage file does not exist" + echo "Coverage file does not exist. Please run tests before executing" exit 1 fi @@ -26,20 +28,5 @@ xcrun xccov view $cov_result --json > output.json percentage=`node -e "console.log(require('./output.json').lineCoverage)"` cov=$(printf "%.2f" $(echo "$percentage*100" | bc -l)) -# -# Create a formatted JSON file with the current coverage. -# -current_date=$(TZ=UTC date +"%Y-%m-%d") -file_name=ios_coverage.json -cat <<EOF > $file_name - {"code_coverage":$cov,"platform":"ios","sdk":"maps","scheme":"CI","created_at":"$current_date"} -EOF - -gzip -f $file_name -# -# upload to AWS -# -if [ -z `which aws` ]; then - brew install awscli -fi -aws s3 cp $file_name.gz s3://mapbox-loading-dock/raw/mobile.codecoverage/$current_date/
\ No newline at end of file +# Generate a formatted JSON file and upload it to S3. +./././scripts/code-coverage.sh $cov "ios" "$1" |