Skip to content

Commit

Permalink
ci(spanner): improve performance of samples tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sakthivelmanii committed Dec 16, 2024
1 parent 801346a commit 63189a3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions samples/install-without-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.2</version>
<configuration>
<forkCount>10</forkCount>
<reuseForks>false</reuseForks>
<systemPropertyVariables>
<spanner.test.instance>java-sample-integration-tests</spanner.test.instance>
<spanner.test.instance.mr>java-client-mr-integration-tests</spanner.test.instance.mr>
Expand All @@ -157,6 +159,9 @@
<spanner.sample.database>mysample</spanner.sample.database>
<spanner.quickstart.database>quick-db</spanner.quickstart.database>
</systemPropertyVariables>
<excludes>
<exclude>**/SpannerSampleIT.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
Expand Down
5 changes: 5 additions & 0 deletions samples/snapshot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.2</version>
<configuration>
<forkCount>10</forkCount>
<reuseForks>false</reuseForks>
<systemPropertyVariables>
<spanner.test.instance>java-sample-integration-tests</spanner.test.instance>
<spanner.test.instance.mr>java-client-mr-integration-tests</spanner.test.instance.mr>
Expand All @@ -157,6 +159,9 @@
<spanner.sample.instance>mysample-instance</spanner.sample.instance>
<spanner.quickstart.database>quick-db</spanner.quickstart.database>
</systemPropertyVariables>
<excludes>
<exclude>**/SpannerSampleIT.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
Expand Down
5 changes: 5 additions & 0 deletions samples/snippets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.2</version>
<configuration>
<forkCount>10</forkCount>
<reuseForks>false</reuseForks>
<systemPropertyVariables>
<spanner.test.instance>java-sample-integration-tests</spanner.test.instance>
<spanner.test.instance.mr>java-client-mr-integration-tests</spanner.test.instance.mr>
Expand All @@ -187,6 +189,9 @@
<spanner.sample.database>mysample</spanner.sample.database>
<spanner.quickstart.database>quick-db</spanner.quickstart.database>
</systemPropertyVariables>
<excludes>
<exclude>**/SpannerSampleIT.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertTrue;

import com.example.spanner.helper.SlowTest;
import com.google.cloud.Timestamp;
import com.google.cloud.spanner.DatabaseId;
import com.google.cloud.spanner.ErrorCode;
Expand Down Expand Up @@ -51,12 +52,14 @@
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Unit tests for {@code SpannerSample} */
@RunWith(JUnit4.class)
@SuppressWarnings("checkstyle:abbreviationaswordinname")
@Category(SlowTest.class)
public class SpannerSampleIT extends SampleTestBaseV2 {

private static final int DBID_LENGTH = 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.junit.Assert.assertTrue;

import com.example.spanner.SampleRunner;
import com.example.spanner.helper.SlowTest;
import com.google.cloud.Timestamp;
import com.google.cloud.spanner.Backup;
import com.google.cloud.spanner.BackupId;
Expand Down Expand Up @@ -48,6 +49,7 @@
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.threeten.bp.LocalDate;
Expand All @@ -56,6 +58,7 @@
/** Unit tests for {@code SpannerSample} */
@RunWith(JUnit4.class)
@SuppressWarnings("checkstyle:abbreviationaswordinname")
@Category(SlowTest.class)
public class SpannerSampleIT {
private static final int DBID_LENGTH = 20;
// The instance needs to exist for tests to pass.
Expand Down

0 comments on commit 63189a3

Please sign in to comment.