Skip to content

Commit

Permalink
fix: Prevent integration tests from different profiles from trampling…
Browse files Browse the repository at this point in the history
… each other (#69)
  • Loading branch information
igorbernstein2 authored and kolea2 committed Nov 7, 2019
1 parent 5aa8769 commit 638615a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 33 deletions.
28 changes: 3 additions & 25 deletions google-cloud-bigtable/pom.xml
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
10 changes: 2 additions & 8 deletions scripts/setup-test-table.sh
Expand Up @@ -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.