Skip to content
Permalink
Browse files
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.
  • Loading branch information
thiagotnunes committed Sep 13, 2021
1 parent dc1f9a9 commit fe2ad14eae2002552d61e497f9892c96584efc24
Showing with 74 additions and 51 deletions.
  1. +6 −6 google-cloud-spanner/pom.xml
  2. +25 −0 google-cloud-spanner/src/test/java/com/google/cloud/spanner/FlakyTest.java
  3. +0 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/ITSessionPoolIntegrationTest.java
  4. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/{categories → }/IntegrationTest.java
  5. +1 −1 ...cloud-spanner/src/test/java/com/google/cloud/spanner/{categories → }/ParallelIntegrationTest.java
  6. +1 −1 ...e-cloud-spanner/src/test/java/com/google/cloud/spanner/{categories → }/SerialIntegrationTest.java
  7. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/{categories → }/SlowTest.java
  8. +0 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpanTest.java
  9. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/{categories → }/TracerTest.java
  10. +1 −1 ...oud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITAsyncTransactionRetryTest.java
  11. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITBulkConnectionTest.java
  12. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITCommitResponseTest.java
  13. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITDdlTest.java
  14. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITReadOnlySpannerTest.java
  15. +1 −1 ...panner/src/test/java/com/google/cloud/spanner/connection/it/ITReadWriteAutocommitSpannerTest.java
  16. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITSqlMusicScriptTest.java
  17. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITSqlScriptTest.java
  18. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITTransactionModeTest.java
  19. +1 −1 ...le-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITTransactionRetryTest.java
  20. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITAsyncAPITest.java
  21. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITAsyncExamplesTest.java
  22. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBatchDmlTest.java
  23. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITBatchReadTest.java
  24. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITClosedSessionTest.java
  25. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITCommitTimestampTest.java
  26. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDMLTest.java
  27. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseAdminTest.java
  28. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseTest.java
  29. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDirectPathFallback.java
  30. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITInstanceAdminTest.java
  31. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITJsonWriteReadTest.java
  32. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITLargeReadTest.java
  33. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrCreateDatabaseTest.java
  34. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITPitrUpdateDatabaseTest.java
  35. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryOptionsTest.java
  36. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITQueryTest.java
  37. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITReadOnlyTxnTest.java
  38. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITReadTest.java
  39. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITResultSetGetValue.java
  40. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITSpannerOptionsTest.java
  41. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITTransactionManagerAsyncTest.java
  42. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITTransactionManagerTest.java
  43. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITTransactionTest.java
  44. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITVPCNegativeTest.java
  45. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITWithGrpcGcpTest.java
  46. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITWriteTest.java
  47. +1 −1 google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/slow/ITBackupTest.java
@@ -50,7 +50,7 @@
<!-- Executes unit tests -->
<id>default-test</id>
<configuration>
<excludedGroups>com.google.cloud.spanner.categories.TracerTest,com.google.cloud.spanner.categories.IntegrationTest</excludedGroups>
<excludedGroups>com.google.cloud.spanner.TracerTest,com.google.cloud.spanner.IntegrationTest</excludedGroups>
</configuration>
</execution>
<execution>
@@ -59,7 +59,7 @@
<goal>test</goal>
</goals>
<configuration>
<groups>com.google.cloud.spanner.categories.TracerTest</groups>
<groups>com.google.cloud.spanner.TracerTest</groups>
</configuration>
</execution>
</executions>
@@ -81,7 +81,7 @@
<execution>
<id>default</id>
<configuration>
<groups>com.google.cloud.spanner.categories.SerialIntegrationTest</groups>
<groups>com.google.cloud.spanner.SerialIntegrationTest</groups>
</configuration>
</execution>
<!-- Executes parallel integration tests -->
@@ -91,7 +91,7 @@
<goal>integration-test</goal>
</goals>
<configuration>
<groups>com.google.cloud.spanner.categories.ParallelIntegrationTest</groups>
<groups>com.google.cloud.spanner.ParallelIntegrationTest</groups>
<forkCount>8</forkCount>
<reuseForks>true</reuseForks>
</configuration>
@@ -377,7 +377,7 @@
<execution>
<id>default-test</id>
<configuration>
<groups>com.google.cloud.spanner.categories.SlowTest</groups>
<groups>com.google.cloud.spanner.SlowTest</groups>
</configuration>
</execution>
</executions>
@@ -389,7 +389,7 @@
<execution>
<id>default</id>
<configuration>
<groups>com.google.cloud.spanner.categories.SlowTest</groups>
<groups>com.google.cloud.spanner.SlowTest</groups>
</configuration>
</execution>
<!-- Overrides default configuration to skip this step -->
@@ -0,0 +1,25 @@
/*
* Copyright 2017 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.spanner;

/**
* Annotation for JUnit {@link org.junit.experimental.categories.Category} that indicates a test is
* flaky. These will be excluded from integration tests. Use this annotation sparingly: typically it
* should only be used for a test where the flakiness is dependent on a fix in a module dependency
* (for example, grpc-java) and cannot be addressed locally.
*/
public interface FlakyTest {}
@@ -20,7 +20,6 @@

import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory;
import com.google.cloud.spanner.SessionPool.PooledSessionFuture;
import com.google.cloud.spanner.categories.SerialIntegrationTest;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
@@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.cloud.spanner.categories;
package com.google.cloud.spanner;

/** Integration Test interface. */
public interface IntegrationTest {}
@@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.cloud.spanner.categories;
package com.google.cloud.spanner;

/** Parallel Integration Test interface. */
public interface ParallelIntegrationTest extends IntegrationTest {}
@@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.cloud.spanner.categories;
package com.google.cloud.spanner;

/** Serial Integration Test interface. */
public interface SerialIntegrationTest {}
@@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.cloud.spanner.categories;
package com.google.cloud.spanner;

/** Category of slow tests, to be run on the nightly build * */
public interface SlowTest extends IntegrationTest {}
@@ -25,7 +25,6 @@
import com.google.cloud.NoCredentials;
import com.google.cloud.spanner.MockSpannerServiceImpl.SimulatedExecutionTime;
import com.google.cloud.spanner.MockSpannerServiceImpl.StatementResult;
import com.google.cloud.spanner.categories.TracerTest;
import com.google.protobuf.ListValue;
import com.google.spanner.v1.ResultSetMetadata;
import com.google.spanner.v1.StructType;
@@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.cloud.spanner.categories;
package com.google.cloud.spanner;

/**
* Tests marked with this {@link org.junit.experimental.categories.Category} will be executed in a
@@ -33,11 +33,11 @@
import com.google.cloud.spanner.KeySet;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.Options;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SpannerExceptionFactory;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.Struct;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.Connection;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import com.google.cloud.spanner.connection.TransactionRetryListener;
@@ -21,8 +21,8 @@
import static org.hamcrest.MatcherAssert.assertThat;

import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SerialIntegrationTest;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.categories.SerialIntegrationTest;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import java.util.ArrayList;
import java.util.List;
@@ -25,9 +25,9 @@

import com.google.cloud.spanner.KeySet;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import org.junit.Before;
import org.junit.Test;
@@ -16,7 +16,7 @@

package com.google.cloud.spanner.connection.it;

import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import com.google.cloud.spanner.connection.SqlScriptVerifier;
import org.junit.Test;
@@ -28,11 +28,11 @@
import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.Options;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ReadContext.QueryAnalyzeMode;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import com.google.cloud.spanner.connection.SqlScriptVerifier;
import java.math.BigInteger;
@@ -24,11 +24,11 @@

import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SpannerBatchUpdateException;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import com.google.cloud.spanner.connection.SqlScriptVerifier;
import java.util.Arrays;
@@ -24,9 +24,9 @@

import com.google.cloud.spanner.AbortedDueToConcurrentModificationException;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.AbstractSqlScriptVerifier.GenericConnection;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import com.google.cloud.spanner.connection.SqlScriptVerifier;
@@ -19,8 +19,8 @@
import static com.google.cloud.spanner.testing.EmulatorSpannerHelper.isUsingEmulator;

import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import com.google.cloud.spanner.connection.SqlScriptVerifier;
import com.google.cloud.spanner.connection.SqlScriptVerifier.SpannerGenericConnection;
@@ -25,10 +25,10 @@
import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.Key;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import com.google.cloud.spanner.connection.SqlScriptVerifier;
import java.util.Arrays;
@@ -27,10 +27,10 @@
import com.google.cloud.spanner.AbortedException;
import com.google.cloud.spanner.KeySet;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.ITAbstractSpannerTest;
import com.google.cloud.spanner.connection.TransactionRetryListener;
import java.sql.Connection;
@@ -42,13 +42,13 @@
import com.google.cloud.spanner.KeySet;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.Options;
import com.google.cloud.spanner.SerialIntegrationTest;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.Struct;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.Type;
import com.google.cloud.spanner.Type.StructField;
import com.google.cloud.spanner.categories.SerialIntegrationTest;
import com.google.cloud.spanner.testing.RemoteSpannerHelper;
import com.google.common.util.concurrent.SettableFuture;
import java.util.ArrayList;
@@ -34,10 +34,10 @@
import com.google.cloud.spanner.KeySet;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ReadOnlyTransaction;
import com.google.cloud.spanner.SerialIntegrationTest;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.Struct;
import com.google.cloud.spanner.categories.SerialIntegrationTest;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import java.util.ArrayList;
@@ -23,12 +23,12 @@
import com.google.cloud.spanner.DatabaseClient;
import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.IntegrationTestEnv;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.SpannerBatchUpdateException;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.TransactionRunner;
import com.google.cloud.spanner.TransactionRunner.TransactionCallable;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata;
import java.util.ArrayList;
import java.util.Collections;
@@ -28,12 +28,12 @@
import com.google.cloud.spanner.IntegrationTestEnv;
import com.google.cloud.spanner.KeySet;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.Partition;
import com.google.cloud.spanner.PartitionOptions;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hashing;
import java.util.ArrayList;
@@ -24,6 +24,7 @@
import com.google.cloud.spanner.Database;
import com.google.cloud.spanner.IntegrationTestWithClosedSessionsEnv;
import com.google.cloud.spanner.IntegrationTestWithClosedSessionsEnv.DatabaseClientWithClosedSessionImpl;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ReadOnlyTransaction;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SessionNotFoundException;
@@ -32,7 +33,6 @@
import com.google.cloud.spanner.TransactionContext;
import com.google.cloud.spanner.TransactionManager;
import com.google.cloud.spanner.TransactionRunner;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import java.util.concurrent.TimeUnit;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -28,11 +28,11 @@
import com.google.cloud.spanner.Key;
import com.google.cloud.spanner.KeySet;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.Struct;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.Value;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.connection.ConnectionOptions;
import com.google.cloud.spanner.testing.RemoteSpannerHelper;
import com.google.common.collect.ImmutableList;
@@ -28,14 +28,14 @@
import com.google.cloud.spanner.KeyRange;
import com.google.cloud.spanner.KeySet;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.SpannerExceptionFactory;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.TransactionRunner;
import com.google.cloud.spanner.TransactionRunner.TransactionCallable;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import java.util.Collections;
import org.junit.Before;
import org.junit.BeforeClass;
@@ -31,10 +31,10 @@
import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.IntegrationTestEnv;
import com.google.cloud.spanner.Options;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.Spanner;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.SpannerOptions;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.testing.RemoteSpannerHelper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
@@ -36,12 +36,12 @@
import com.google.cloud.spanner.IntegrationTestEnv;
import com.google.cloud.spanner.KeySet;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.ResultSet;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.Statement;
import com.google.cloud.spanner.TransactionContext;
import com.google.cloud.spanner.TransactionRunner.TransactionCallable;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.spanner.admin.database.v1.CreateDatabaseMetadata;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -27,9 +27,9 @@
import com.google.cloud.spanner.IntegrationTestEnv;
import com.google.cloud.spanner.Key;
import com.google.cloud.spanner.Mutation;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.SpannerOptions;
import com.google.cloud.spanner.TimestampBound;
import com.google.cloud.spanner.categories.ParallelIntegrationTest;
import com.google.cloud.spanner.testing.RemoteSpannerHelper;
import com.google.common.base.Stopwatch;
import io.grpc.ManagedChannelBuilder;

0 comments on commit fe2ad14

Please sign in to comment.