Skip to content
Permalink
Browse files
fix: Prevent integration tests from different profiles from trampling…
… each other (#69)
  • Loading branch information
igorbernstein2 authored and kolea2 committed Nov 7, 2019
1 parent 5aa8769 commit 638615ae09ec2d311e82d89ea7a78137911f4eb4
Showing with 5 additions and 33 deletions.
  1. +3 −25 google-cloud-bigtable/pom.xml
  2. +2 −8 scripts/setup-test-table.sh
@@ -220,6 +220,7 @@
<include>com.google.cloud.bigtable.**.it.*IT</include>
</includes>
<summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-emulator-it.xml</summaryFile>
<reportsDirectory>${project.build.directory}/failsafe-reports/emulator-it</reportsDirectory>
</configuration>
</execution>
</executions>
@@ -249,6 +250,7 @@
<include>com.google.cloud.bigtable.**.it.*IT</include>
</includes>
<summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-prod-it.xml</summaryFile>
<reportsDirectory>${project.build.directory}/failsafe-reports/prod-it</reportsDirectory>
</configuration>
</execution>
</executions>
@@ -290,6 +292,7 @@
<include>com.google.cloud.bigtable.data.v2.it.*IT</include>
</includes>
<summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-directpath-it.xml</summaryFile>
<reportsDirectory>${project.build.directory}/failsafe-reports/directpath-it</reportsDirectory>
</configuration>
</execution>
</executions>
@@ -332,31 +335,6 @@
</configuration>
</plugin>

<!-- Workaround maven failing to delete old test reports. For some reason, when using the
failsafe plugin in profiles, maven retains the counts from previous executions. Causing a
stale failure to fail the current test run. -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>clean-old-reports</id>
<goals>
<goal>clean</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${project.build.directory}/failsafe-reports</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
@@ -36,13 +36,7 @@ for ADMIN_HOST in "${ADMIN_HOSTS[@]}"; do
fi

# Ensure that the table exists
if ! call_cbt -instance ${INSTANCE_ID} ls | grep -q "^${TABLE_ID}\$"; then
call_cbt createtable ${TABLE_ID}
fi

# Ensure that the family exists
if ! call_cbt ls "${TABLE_ID}" | grep -q "^$FAMILY\b"; then
call_cbt createfamily "${TABLE_ID}" "${FAMILY}"
call_cbt setgcpolicy "${TABLE_ID}" "${FAMILY}" maxversions=1 maxage=1h
if ! call_cbt -instance "$INSTANCE_ID" ls | grep -q "^${TABLE_ID}\$"; then
call_cbt createtable "$TABLE_ID" "families=$FAMILY:maxversions=1||maxage=1h"
fi
done

0 comments on commit 638615a

Please sign in to comment.