Skip to content

Commit 638615a

Browse files
igorbernstein2kolea2
authored andcommitted
fix: Prevent integration tests from different profiles from trampling each other (#69)
1 parent 5aa8769 commit 638615a

File tree

2 files changed

+5
-33
lines changed

2 files changed

+5
-33
lines changed

google-cloud-bigtable/pom.xml

+3-25
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
<include>com.google.cloud.bigtable.**.it.*IT</include>
221221
</includes>
222222
<summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-emulator-it.xml</summaryFile>
223+
<reportsDirectory>${project.build.directory}/failsafe-reports/emulator-it</reportsDirectory>
223224
</configuration>
224225
</execution>
225226
</executions>
@@ -249,6 +250,7 @@
249250
<include>com.google.cloud.bigtable.**.it.*IT</include>
250251
</includes>
251252
<summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-prod-it.xml</summaryFile>
253+
<reportsDirectory>${project.build.directory}/failsafe-reports/prod-it</reportsDirectory>
252254
</configuration>
253255
</execution>
254256
</executions>
@@ -290,6 +292,7 @@
290292
<include>com.google.cloud.bigtable.data.v2.it.*IT</include>
291293
</includes>
292294
<summaryFile>${project.build.directory}/failsafe-reports/failsafe-summary-directpath-it.xml</summaryFile>
295+
<reportsDirectory>${project.build.directory}/failsafe-reports/directpath-it</reportsDirectory>
293296
</configuration>
294297
</execution>
295298
</executions>
@@ -332,31 +335,6 @@
332335
</configuration>
333336
</plugin>
334337

335-
<!-- Workaround maven failing to delete old test reports. For some reason, when using the
336-
failsafe plugin in profiles, maven retains the counts from previous executions. Causing a
337-
stale failure to fail the current test run. -->
338-
<plugin>
339-
<artifactId>maven-clean-plugin</artifactId>
340-
<version>2.5</version>
341-
<executions>
342-
<execution>
343-
<id>clean-old-reports</id>
344-
<goals>
345-
<goal>clean</goal>
346-
</goals>
347-
<phase>pre-integration-test</phase>
348-
<configuration>
349-
<excludeDefaultDirectories>true</excludeDefaultDirectories>
350-
<filesets>
351-
<fileset>
352-
<directory>${project.build.directory}/failsafe-reports</directory>
353-
</fileset>
354-
</filesets>
355-
</configuration>
356-
</execution>
357-
</executions>
358-
</plugin>
359-
360338
<plugin>
361339
<groupId>org.apache.maven.plugins</groupId>
362340
<artifactId>maven-failsafe-plugin</artifactId>

scripts/setup-test-table.sh

+2-8
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,7 @@ for ADMIN_HOST in "${ADMIN_HOSTS[@]}"; do
3636
fi
3737

3838
# Ensure that the table exists
39-
if ! call_cbt -instance ${INSTANCE_ID} ls | grep -q "^${TABLE_ID}\$"; then
40-
call_cbt createtable ${TABLE_ID}
41-
fi
42-
43-
# Ensure that the family exists
44-
if ! call_cbt ls "${TABLE_ID}" | grep -q "^$FAMILY\b"; then
45-
call_cbt createfamily "${TABLE_ID}" "${FAMILY}"
46-
call_cbt setgcpolicy "${TABLE_ID}" "${FAMILY}" maxversions=1 maxage=1h
39+
if ! call_cbt -instance "$INSTANCE_ID" ls | grep -q "^${TABLE_ID}\$"; then
40+
call_cbt createtable "$TABLE_ID" "families=$FAMILY:maxversions=1||maxage=1h"
4741
fi
4842
done

0 commit comments

Comments
 (0)