Skip to content

Commit fe2ad14

Browse files
authored
fix: revert test category refactoring (#1419)
Reverts moving the category interfaces of tests to their own package. This is because we export the tests as a jar to maven and it could break application code.
1 parent dc1f9a9 commit fe2ad14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+74
-51
lines changed

google-cloud-spanner/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<!-- Executes unit tests -->
5151
<id>default-test</id>
5252
<configuration>
53-
<excludedGroups>com.google.cloud.spanner.categories.TracerTest,com.google.cloud.spanner.categories.IntegrationTest</excludedGroups>
53+
<excludedGroups>com.google.cloud.spanner.TracerTest,com.google.cloud.spanner.IntegrationTest</excludedGroups>
5454
</configuration>
5555
</execution>
5656
<execution>
@@ -59,7 +59,7 @@
5959
<goal>test</goal>
6060
</goals>
6161
<configuration>
62-
<groups>com.google.cloud.spanner.categories.TracerTest</groups>
62+
<groups>com.google.cloud.spanner.TracerTest</groups>
6363
</configuration>
6464
</execution>
6565
</executions>
@@ -81,7 +81,7 @@
8181
<execution>
8282
<id>default</id>
8383
<configuration>
84-
<groups>com.google.cloud.spanner.categories.SerialIntegrationTest</groups>
84+
<groups>com.google.cloud.spanner.SerialIntegrationTest</groups>
8585
</configuration>
8686
</execution>
8787
<!-- Executes parallel integration tests -->
@@ -91,7 +91,7 @@
9191
<goal>integration-test</goal>
9292
</goals>
9393
<configuration>
94-
<groups>com.google.cloud.spanner.categories.ParallelIntegrationTest</groups>
94+
<groups>com.google.cloud.spanner.ParallelIntegrationTest</groups>
9595
<forkCount>8</forkCount>
9696
<reuseForks>true</reuseForks>
9797
</configuration>
@@ -377,7 +377,7 @@
377377
<execution>
378378
<id>default-test</id>
379379
<configuration>
380-
<groups>com.google.cloud.spanner.categories.SlowTest</groups>
380+
<groups>com.google.cloud.spanner.SlowTest</groups>
381381
</configuration>
382382
</execution>
383383
</executions>
@@ -389,7 +389,7 @@
389389
<execution>
390390
<id>default</id>
391391
<configuration>
392-
<groups>com.google.cloud.spanner.categories.SlowTest</groups>
392+
<groups>com.google.cloud.spanner.SlowTest</groups>
393393
</configuration>
394394
</execution>
395395
<!-- Overrides default configuration to skip this step -->
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2017 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.spanner;
18+
19+
/**
20+
* Annotation for JUnit {@link org.junit.experimental.categories.Category} that indicates a test is
21+
* flaky. These will be excluded from integration tests. Use this annotation sparingly: typically it
22+
* should only be used for a test where the flakiness is dependent on a fix in a module dependency
23+
* (for example, grpc-java) and cannot be addressed locally.
24+
*/
25+
public interface FlakyTest {}

google-cloud-spanner/src/test/java/com/google/cloud/spanner/ITSessionPoolIntegrationTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory;
2222
import com.google.cloud.spanner.SessionPool.PooledSessionFuture;
23-
import com.google.cloud.spanner.categories.SerialIntegrationTest;
2423
import java.util.ArrayList;
2524
import java.util.List;
2625
import java.util.concurrent.CountDownLatch;

google-cloud-spanner/src/test/java/com/google/cloud/spanner/categories/IntegrationTest.java renamed to google-cloud-spanner/src/test/java/com/google/cloud/spanner/IntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.cloud.spanner.categories;
17+
package com.google.cloud.spanner;
1818

1919
/** Integration Test interface. */
2020
public interface IntegrationTest {}

google-cloud-spanner/src/test/java/com/google/cloud/spanner/categories/ParallelIntegrationTest.java renamed to google-cloud-spanner/src/test/java/com/google/cloud/spanner/ParallelIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.cloud.spanner.categories;
17+
package com.google.cloud.spanner;
1818

1919
/** Parallel Integration Test interface. */
2020
public interface ParallelIntegrationTest extends IntegrationTest {}

google-cloud-spanner/src/test/java/com/google/cloud/spanner/categories/SerialIntegrationTest.java renamed to google-cloud-spanner/src/test/java/com/google/cloud/spanner/SerialIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.cloud.spanner.categories;
17+
package com.google.cloud.spanner;
1818

1919
/** Serial Integration Test interface. */
2020
public interface SerialIntegrationTest {}

google-cloud-spanner/src/test/java/com/google/cloud/spanner/categories/SlowTest.java renamed to google-cloud-spanner/src/test/java/com/google/cloud/spanner/SlowTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.cloud.spanner.categories;
17+
package com.google.cloud.spanner;
1818

1919
/** Category of slow tests, to be run on the nightly build * */
2020
public interface SlowTest extends IntegrationTest {}

google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import com.google.cloud.NoCredentials;
2626
import com.google.cloud.spanner.MockSpannerServiceImpl.SimulatedExecutionTime;
2727
import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult;
28-
import com.google.cloud.spanner.categories.TracerTest;
2928
import com.google.protobuf.ListValue;
3029
import com.google.spanner.v1.ResultSetMetadata;
3130
import com.google.spanner.v1.StructType;

google-cloud-spanner/src/test/java/com/google/cloud/spanner/categories/TracerTest.java renamed to google-cloud-spanner/src/test/java/com/google/cloud/spanner/TracerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.google.cloud.spanner.categories;
17+
package com.google.cloud.spanner;
1818

1919
/**
2020
* Tests marked with this {@link org.junit.experimental.categories.Category} will be executed in a

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITAsyncTransactionRetryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
import com.google.cloud.spanner.KeySet;
3434
import com.google.cloud.spanner.Mutation;
3535
import com.google.cloud.spanner.Options;
36+
import com.google.cloud.spanner.ParallelIntegrationTest;
3637
import com.google.cloud.spanner.ResultSet;
3738
import com.google.cloud.spanner.SpannerExceptionFactory;
3839
import com.google.cloud.spanner.Statement;
3940
import com.google.cloud.spanner.Struct;
40-
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
4141
import com.google.cloud.spanner.connection.Connection;
4242
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
4343
import com.google.cloud.spanner.connection.TransactionRetryListener;

0 commit comments

Comments
 (0)