Skip to content

Commit 69e2cda

Browse files
authored
Add codecov (#3842)
* Setup Kokoro to run codecov script after tests * Enable jacoco plugin to capture code coverage in clients
1 parent 9745d90 commit 69e2cda

7 files changed

Lines changed: 83 additions & 8 deletions

File tree

.kokoro/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fi
3131
case $JOB_TYPE in
3232
test)
3333
mvn test -B
34+
bash $KOKORO_GFILE_DIR/codecov.sh
3435
;;
3536
javadoc)
3637
mvn javadoc:javadoc javadoc:test-javadoc

.kokoro/continuous/common.cfg

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ before_action {
2828
keystore_resource {
2929
keystore_config_id: 73713
3030
keyname: "java_it_service_account"
31-
# TODO(chingor): remove this after secrets have globally propagated
32-
backend_type: FASTCONFIGPUSH
3331
}
3432
}
3533
}
@@ -39,8 +37,16 @@ before_action {
3937
keystore_resource {
4038
keystore_config_id: 73713
4139
keyname: "java_firestore_it_service_account"
42-
# TODO(chingor): remove this after secrets have globally propagated
43-
backend_type: FASTCONFIGPUSH
40+
}
41+
}
42+
}
43+
44+
# Request the codecov master token
45+
before_action {
46+
fetch_keystore {
47+
keystore_resource {
48+
keystore_config_id: 73713
49+
keyname: "dpebot_codecov_token"
4450
}
4551
}
4652
}

.kokoro/presubmit/common.cfg

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ before_action {
2828
keystore_resource {
2929
keystore_config_id: 73713
3030
keyname: "java_it_service_account"
31-
# TODO(chingor): remove this after secrets have globally propagated
32-
backend_type: FASTCONFIGPUSH
3331
}
3432
}
3533
}
@@ -39,8 +37,17 @@ before_action {
3937
keystore_resource {
4038
keystore_config_id: 73713
4139
keyname: "java_firestore_it_service_account"
42-
# TODO(chingor): remove this after secrets have globally propagated
43-
backend_type: FASTCONFIGPUSH
4440
}
4541
}
4642
}
43+
44+
# Request the codecov master token
45+
before_action {
46+
fetch_keystore {
47+
keystore_resource {
48+
keystore_config_id: 73713
49+
keyname: "dpebot_codecov_token"
50+
}
51+
}
52+
}
53+

codecov.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
codecov:
3+
ci:
4+
- source.cloud.google.com

google-api-grpc/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,25 @@
788788
</reportPlugins>
789789
</configuration>
790790
</plugin>
791+
<plugin>
792+
<groupId>org.jacoco</groupId>
793+
<artifactId>jacoco-maven-plugin</artifactId>
794+
<version>0.8.2</version>
795+
<executions>
796+
<execution>
797+
<goals>
798+
<goal>prepare-agent</goal>
799+
</goals>
800+
</execution>
801+
<execution>
802+
<id>report</id>
803+
<phase>test</phase>
804+
<goals>
805+
<goal>report</goal>
806+
</goals>
807+
</execution>
808+
</executions>
809+
</plugin>
791810
</plugins>
792811
</build>
793812
<reporting>

google-cloud-bom/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,25 @@
11271127
</reportPlugins>
11281128
</configuration>
11291129
</plugin>
1130+
<plugin>
1131+
<groupId>org.jacoco</groupId>
1132+
<artifactId>jacoco-maven-plugin</artifactId>
1133+
<version>0.8.2</version>
1134+
<executions>
1135+
<execution>
1136+
<goals>
1137+
<goal>prepare-agent</goal>
1138+
</goals>
1139+
</execution>
1140+
<execution>
1141+
<id>report</id>
1142+
<phase>test</phase>
1143+
<goals>
1144+
<goal>report</goal>
1145+
</goals>
1146+
</execution>
1147+
</executions>
1148+
</plugin>
11301149
</plugins>
11311150
</build>
11321151

google-cloud-clients/pom.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,25 @@
765765
</reportPlugins>
766766
</configuration>
767767
</plugin>
768+
<plugin>
769+
<groupId>org.jacoco</groupId>
770+
<artifactId>jacoco-maven-plugin</artifactId>
771+
<version>0.8.2</version>
772+
<executions>
773+
<execution>
774+
<goals>
775+
<goal>prepare-agent</goal>
776+
</goals>
777+
</execution>
778+
<execution>
779+
<id>report</id>
780+
<phase>test</phase>
781+
<goals>
782+
<goal>report</goal>
783+
</goals>
784+
</execution>
785+
</executions>
786+
</plugin>
768787
</plugins>
769788
</build>
770789

0 commit comments

Comments
 (0)