Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mutianf committed Nov 22, 2023
1 parent 3b4c178 commit abad657
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ source ${scriptDir}/common.sh
mvn -version
echo ${JOB_TYPE}

mvn dependency:tree

# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V -ntp \
Expand Down
1 change: 1 addition & 0 deletions google-cloud-bigtable/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<scope>test</scope>
<exclusions>
<!-- TODO: consider a different approach -->
<!-- exclude to resolve conflict with guava -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.google.cloud.bigtable.data.v2.stub;

import static com.google.cloud.bigtable.data.v2.stub.CookiesHolderTest.MetadataSubject.assertThat;
import static com.google.common.truth.Truth.assertAbout;
import static com.google.common.truth.Truth.assertThat;

Expand Down Expand Up @@ -154,9 +153,9 @@ public void testReadRows() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
MetadataSubject.assertThat(lastMetadata)
.containsAtLeast(ROUTING_COOKIE_1.name(), "readRows", ROUTING_COOKIE_2.name(), testCookie);
assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());
MetadataSubject.assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());

serverMetadata.clear();
}
Expand All @@ -170,9 +169,9 @@ public void testReadRow() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
MetadataSubject.assertThat(lastMetadata)
.containsAtLeast(ROUTING_COOKIE_1.name(), "readRows", ROUTING_COOKIE_2.name(), testCookie);
assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());
MetadataSubject.assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());

serverMetadata.clear();
}
Expand All @@ -188,10 +187,9 @@ public void testMutateRows() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
.containsAtLeast(
ROUTING_COOKIE_1.name(), "mutateRows", ROUTING_COOKIE_2.name(), testCookie);
assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());
MetadataSubject.assertThat(lastMetadata)
.containsAtLeast(ROUTING_COOKIE_1.name(), "readRows", ROUTING_COOKIE_2.name(), testCookie);
MetadataSubject.assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());

serverMetadata.clear();
}
Expand All @@ -205,9 +203,9 @@ public void testMutateRow() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
.containsAtLeast(ROUTING_COOKIE_1.name(), "mutateRow", ROUTING_COOKIE_2.name(), testCookie);
assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());
MetadataSubject.assertThat(lastMetadata)
.containsAtLeast(ROUTING_COOKIE_1.name(), "readRows", ROUTING_COOKIE_2.name(), testCookie);
MetadataSubject.assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());

serverMetadata.clear();
}
Expand All @@ -222,10 +220,9 @@ public void testSampleRowKeys() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
.containsAtLeast(
ROUTING_COOKIE_1.name(), "sampleRowKeys", ROUTING_COOKIE_2.name(), testCookie);
assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());
MetadataSubject.assertThat(lastMetadata)
.containsAtLeast(ROUTING_COOKIE_1.name(), "readRows", ROUTING_COOKIE_2.name(), testCookie);
MetadataSubject.assertThat(lastMetadata).doesNotContainKeys(BAD_KEY.name());

serverMetadata.clear();
}
Expand All @@ -241,7 +238,8 @@ public void testNoCookieSucceedReadRows() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata).doesNotContainKeys(ROUTING_COOKIE_1.name(), ROUTING_COOKIE_2.name());
MetadataSubject.assertThat(lastMetadata)
.doesNotContainKeys(ROUTING_COOKIE_1.name(), ROUTING_COOKIE_2.name());

serverMetadata.clear();
}
Expand All @@ -257,7 +255,7 @@ public void testNoCookieSucceedReadRow() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
MetadataSubject.assertThat(lastMetadata)
.doesNotContainKeys(ROUTING_COOKIE_1.name(), ROUTING_COOKIE_2.name(), BAD_KEY.name());

serverMetadata.clear();
Expand All @@ -276,7 +274,7 @@ public void testNoCookieSucceedMutateRows() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
MetadataSubject.assertThat(lastMetadata)
.doesNotContainKeys(ROUTING_COOKIE_1.name(), ROUTING_COOKIE_2.name(), BAD_KEY.name());

serverMetadata.clear();
Expand All @@ -293,7 +291,7 @@ public void testNoCookieSucceedMutateRow() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
MetadataSubject.assertThat(lastMetadata)
.doesNotContainKeys(ROUTING_COOKIE_1.name(), ROUTING_COOKIE_2.name(), BAD_KEY.name());

serverMetadata.clear();
Expand All @@ -310,7 +308,7 @@ public void testNoCookieSucceedSampleRowKeys() {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
MetadataSubject.assertThat(lastMetadata)
.doesNotContainKeys(ROUTING_COOKIE_1.name(), ROUTING_COOKIE_2.name(), BAD_KEY.name());

serverMetadata.clear();
Expand Down Expand Up @@ -359,7 +357,7 @@ public void sendHeaders(Metadata headers) {

Metadata lastMetadata = serverMetadata.get(fakeService.count.get() - 1);

assertThat(lastMetadata)
MetadataSubject.assertThat(lastMetadata)
.containsAtLeast(
ROUTING_COOKIE_2.name(), testCookie, routingCookieKey.name(), routingCookieValue);

Expand Down

0 comments on commit abad657

Please sign in to comment.