File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,9 @@ case "$product-$method-$platform" in
188
188
test
189
189
190
190
if [[ $platform == ' iOS' ]]; then
191
+ # Code Coverage collection is only working on iOS currently.
192
+ ./scripts/collect_metrics.sh ' Example/Firebase.xcworkspace' " AllUnitTests_$platform "
193
+
191
194
# Run integration tests (not allowed on PRs)
192
195
if [ " $TRAVIS_PULL_REQUEST " == " false" ]; then
193
196
RunXcodebuild \
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Copyright 2019 Google
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # USAGE: ./collect_metrics.sh workspace scheme
18
+ #
19
+ # Collects project health metrics and uploads them to a database. Currently just collects code
20
+ # coverage for the provided workspace and scheme. Assumes that those tests have already been
21
+ # executed.
22
+
23
+ set -euo pipefail
24
+
25
+ if [[ $# -ne 2 ]]; then
26
+ cat 1>&2 << EOF
27
+ USAGE: $0 workspace scheme
28
+
29
+ Collects project health metrics and uploads them to a database. Currently just collects code
30
+ coverage for the provided workspace and scheme. Assumes that those tests have already been
31
+ executed.
32
+ EOF
33
+ exit 1
34
+ fi
35
+
36
+ if [[ ! -z " ${TRAVIS_PULL_REQUEST} " ]]; then
37
+ WORKSPACE=" $1 "
38
+ SCHEME=" $2 "
39
+
40
+ gem install xcov
41
+ xcov --workspace " ${WORKSPACE} " --scheme " ${SCHEME} " --output_directory Metrics --json_report
42
+ cd Metrics
43
+ swift build
44
+ .build/debug/Metrics -c report.json -p " ${TRAVIS_PULL_REQUEST} "
45
+ cd ..
46
+ fi
You can’t perform that action at this time.
0 commit comments