Skip to content

Commit 70cf02e

Browse files
authored
test: switch tracing end-to-end tests to nightly jobs. (#1812)
* test: switch tracing end-to-end tests to nightly jobs. * env vars set in github should begin with `GITHUB_` * testing. * remove print stmt and fix up.
1 parent 92a99d6 commit 70cf02e

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

java-firestore/.kokoro/nightly/common.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ env_vars: {
2323
key: "JOB_TYPE"
2424
value: "test"
2525
}
26+
27+
env_vars: {
28+
key: "GITHUB_ENV_VAR_KOKORO_JOB_TYPE"
29+
value: "nightly"
30+
}

java-firestore/.kokoro/presubmit/common.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ env_vars: {
2424
value: "test"
2525
}
2626

27+
env_vars: {
28+
key: "GITHUB_ENV_VAR_KOKORO_JOB_TYPE"
29+
value: "presubmit"
30+
}
31+
2732
before_action {
2833
fetch_keystore {
2934
keystore_resource {

java-firestore/google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITE2ETracingTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import static org.junit.Assert.assertNotNull;
4141
import static org.junit.Assert.assertNull;
4242
import static org.junit.Assert.assertTrue;
43+
import static org.junit.Assume.assumeTrue;
4344

4445
import com.google.api.gax.rpc.NotFoundException;
4546
import com.google.cloud.firestore.BulkWriter;
@@ -263,12 +264,16 @@ private boolean dfsContainsCallStack(long spanId, List<String> expectedCallStack
263264
// Required to set custom-root span
264265
private static OpenTelemetrySdk openTelemetrySdk;
265266

267+
private static boolean isNightlyTesting;
266268
private static String projectId;
267269

268270
private static Firestore firestore;
269271

270272
@BeforeClass
271273
public static void setup() throws IOException {
274+
String jobType = System.getenv("GITHUB_ENV_VAR_KOKORO_JOB_TYPE");
275+
isNightlyTesting = jobType != null && jobType.equalsIgnoreCase("nightly");
276+
272277
projectId = FirestoreOptions.getDefaultProjectId();
273278
logger.info("projectId:" + projectId);
274279

@@ -361,6 +366,9 @@ public void before() throws Exception {
361366
customSpanContext = getNewSpanContext();
362367
assertNotNull(customSpanContext);
363368
assertNull(retrievedTrace);
369+
370+
// We only perform end-to-end tracing tests on a nightly basis.
371+
assumeTrue(isNightlyTesting);
364372
}
365373

366374
@After

0 commit comments

Comments
 (0)