Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rearrange integration tests #558

Merged
merged 1 commit into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rearrange integration tests
  • Loading branch information
brfrn169 committed Apr 19, 2022
commit 44fd91c380ff9c88afb73f5d70e3191d418fc800
39 changes: 0 additions & 39 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
java-version: '8'
distribution: 'temurin'


- name: Setup and execute Gradle 'check' task
uses: gradle/gradle-build-action@v2
with:
Expand Down Expand Up @@ -432,41 +431,3 @@ jobs:
with:
name: gradle_scalardb_server_integration_test_reports
path: /tmp/gradle_integration_test_reports

integration-test-for-two-phase-consensus-commit:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: mysql
ports:
- 3306:3306

steps:
- uses: actions/checkout@v3

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'

- name: Setup and execute Gradle 'integrationTestTwoPhaseConsensusCommit' task
uses: gradle/gradle-build-action@v2
with:
arguments: integrationTestTwoPhaseConsensusCommit

- name: Save Gradle test reports
if: always()
run: |
mkdir -p /tmp/gradle_integration_test_reports
cp -a core/build/reports/tests/integrationTestTwoPhaseConsensusCommit /tmp/gradle_integration_test_reports/

- name: Upload Gradle test reports
uses: actions/upload-artifact@v3
if: always()
with:
name: gradle_two_phase_consensus_commit_integration_test_reports
path: /tmp/gradle_integration_test_reports
56 changes: 15 additions & 41 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ sourceSets {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
include '**/com/scalar/db/storage/*.java'
include '**/com/scalar/db/api/*.java'
include '**/com/scalar/db/transaction/consensuscommit/*.java'
include '**/com/scalar/db/util/*.java'
include '**/com/scalar/db/storage/cassandra/*.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitIntegrationTestBase.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitWithCassandraIntegrationTest.java'
}
resources.srcDir file('src/integration-test/resources')
}
Expand All @@ -29,10 +29,10 @@ sourceSets {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
include '**/com/scalar/db/storage/*.java'
include '**/com/scalar/db/api/*.java'
include '**/com/scalar/db/transaction/consensuscommit/*.java'
include '**/com/scalar/db/util/*.java'
include '**/com/scalar/db/storage/cosmos/*.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitIntegrationTestBase.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitWithCosmosIntegrationTest.java'
}
resources.srcDir file('src/integration-test/resources')
}
Expand All @@ -41,10 +41,10 @@ sourceSets {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
include '**/com/scalar/db/storage/*.java'
include '**/com/scalar/db/api/*.java'
include '**/com/scalar/db/transaction/consensuscommit/*.java'
include '**/com/scalar/db/util/*.java'
include '**/com/scalar/db/storage/dynamo/*.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitIntegrationTestBase.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitWithDynamoIntegrationTest.java'
}
resources.srcDir file('src/integration-test/resources')
}
Expand All @@ -53,12 +53,10 @@ sourceSets {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
include '**/com/scalar/db/storage/*.java'
include '**/com/scalar/db/api/*.java'
include '**/com/scalar/db/transaction/consensuscommit/*.java'
include '**/com/scalar/db/util/*.java'
include '**/com/scalar/db/storage/jdbc/*.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitIntegrationTestBase.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitWithJdbcDatabaseIntegrationTest.java'
include '**/com/scalar/db/transaction/TransactionAdminIntegrationTestBase.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitAdminWithJdbcDatabaseIntegrationTest.java'
include '**/com/scalar/db/transaction/jdbc/*.java'
}
resources.srcDir file('src/integration-test/resources')
Expand All @@ -68,19 +66,10 @@ sourceSets {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
include '**/com/scalar/db/storage/*.java'
include '**/com/scalar/db/api/*.java'
include '**/com/scalar/db/transaction/consensuscommit/*.java'
include '**/com/scalar/db/util/*.java'
include '**/com/scalar/db/storage/multistorage/*.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitIntegrationTestBase.java'
include '**/com/scalar/db/transaction/consensuscommit/ConsensusCommitWithMultiStorageIntegrationTest.java'
}
resources.srcDir file('src/integration-test/resources')
}
integrationTestTwoPhaseConsensusCommit {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
include '**/com/scalar/db/transaction/consensuscommit/TwoPhaseConsensusCommitIntegrationTest.java'
}
resources.srcDir file('src/integration-test/resources')
}
Expand All @@ -105,9 +94,6 @@ configurations {
integrationTestMultiStorageImplementation.extendsFrom testImplementation
integrationTestMultiStorageRuntimeOnly.extendsFrom testRuntimeOnly
integrationTestMultiStorageCompileOnly.extendsFrom testCompileOnly
integrationTestTwoPhaseConsensusCommitImplementation.extendsFrom testImplementation
integrationTestTwoPhaseConsensusCommitRuntimeOnly.extendsFrom testRuntimeOnly
integrationTestTwoPhaseConsensusCommitCompileOnly.extendsFrom testCompileOnly
}

dependencies {
Expand Down Expand Up @@ -209,18 +195,6 @@ task integrationTestMultiStorage(type: Test) {
}
}

task integrationTestTwoPhaseConsensusCommit(type: Test) {
useJUnitPlatform()
description = 'Runs the integration tests for two-phase consensus commit.'
group = 'verification'
testClassesDirs = sourceSets.integrationTestTwoPhaseConsensusCommit.output.classesDirs
classpath = sourceSets.integrationTestTwoPhaseConsensusCommit.runtimeClasspath
outputs.upToDateWhen { false } // ensures integration tests are run every time when called
options {
systemProperties(System.getProperties())
}
}

task copyDependencies(type: Copy) {
configurations.api.canBeResolved true
configurations.implementation.canBeResolved true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
package com.scalar.db.storage;
package com.scalar.db.api;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import com.scalar.db.api.DistributedStorage;
import com.scalar.db.api.DistributedStorageAdmin;
import com.scalar.db.api.Put;
import com.scalar.db.api.Scan;
import com.scalar.db.api.Scanner;
import com.scalar.db.api.TableMetadata;
import com.scalar.db.config.DatabaseConfig;
import com.scalar.db.exception.storage.ExecutionException;
import com.scalar.db.io.DataType;
import com.scalar.db.io.Key;
import com.scalar.db.service.StorageFactory;
import com.scalar.db.util.TestUtils;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
Expand All @@ -29,7 +24,7 @@
import org.junit.jupiter.api.TestInstance;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public abstract class StorageAdminIntegrationTestBase {
public abstract class DistributedStorageAdminIntegrationTestBase {

private static final String TEST_NAME = "storage_admin";
private static final String NAMESPACE1 = "integration_testing_" + TEST_NAME + "1";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package com.scalar.db.storage;
package com.scalar.db.api;

import static org.assertj.core.api.Assertions.assertThat;

import com.scalar.db.api.DistributedStorage;
import com.scalar.db.api.DistributedStorageAdmin;
import com.scalar.db.api.Get;
import com.scalar.db.api.Put;
import com.scalar.db.api.Result;
import com.scalar.db.api.TableMetadata;
import com.scalar.db.config.DatabaseConfig;
import com.scalar.db.exception.storage.ExecutionException;
import com.scalar.db.io.BigIntValue;
Expand All @@ -21,6 +15,7 @@
import com.scalar.db.io.TextValue;
import com.scalar.db.io.Value;
import com.scalar.db.service.StorageFactory;
import com.scalar.db.util.TestUtils;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -35,7 +30,7 @@
import org.junit.jupiter.api.TestInstance;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public abstract class StorageColumnValueIntegrationTestBase {
public abstract class DistributedStorageColumnValueIntegrationTestBase {

private static final String TEST_NAME = "col_val";
private static final String NAMESPACE = "integration_testing_" + TEST_NAME;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.scalar.db.storage;
package com.scalar.db.api;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand All @@ -7,19 +7,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Ordering;
import com.scalar.db.api.ConditionBuilder;
import com.scalar.db.api.ConditionalExpression;
import com.scalar.db.api.ConditionalExpression.Operator;
import com.scalar.db.api.Consistency;
import com.scalar.db.api.Delete;
import com.scalar.db.api.DistributedStorage;
import com.scalar.db.api.DistributedStorageAdmin;
import com.scalar.db.api.Get;
import com.scalar.db.api.Mutation;
import com.scalar.db.api.MutationCondition;
import com.scalar.db.api.Put;
import com.scalar.db.api.Result;
import com.scalar.db.api.TableMetadata;
import com.scalar.db.config.DatabaseConfig;
import com.scalar.db.exception.storage.ExecutionException;
import com.scalar.db.exception.storage.NoMutationException;
Expand All @@ -34,6 +22,7 @@
import com.scalar.db.io.Key;
import com.scalar.db.io.TextColumn;
import com.scalar.db.service.StorageFactory;
import com.scalar.db.util.TestUtils;
import edu.umd.cs.findbugs.annotations.Nullable;
import java.nio.ByteBuffer;
import java.util.ArrayList;
Expand All @@ -53,7 +42,7 @@
import org.junit.jupiter.api.TestInstance;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public abstract class StorageConditionalMutationIntegrationTestBase {
public abstract class DistributedStorageConditionalMutationIntegrationTestBase {

private static final String TEST_NAME = "cond_mutation";
private static final String NAMESPACE = "integration_testing_" + TEST_NAME;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
package com.scalar.db.storage;
package com.scalar.db.api;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import com.scalar.db.api.ConditionalExpression;
import com.scalar.db.api.Delete;
import com.scalar.db.api.DeleteIf;
import com.scalar.db.api.DeleteIfExists;
import com.scalar.db.api.DistributedStorage;
import com.scalar.db.api.DistributedStorageAdmin;
import com.scalar.db.api.Get;
import com.scalar.db.api.Put;
import com.scalar.db.api.PutIf;
import com.scalar.db.api.PutIfExists;
import com.scalar.db.api.PutIfNotExists;
import com.scalar.db.api.Result;
import com.scalar.db.api.Scan;
import com.scalar.db.api.Scan.Ordering;
import com.scalar.db.api.Scan.Ordering.Order;
import com.scalar.db.api.Scanner;
import com.scalar.db.api.TableMetadata;
import com.scalar.db.config.DatabaseConfig;
import com.scalar.db.exception.storage.ExecutionException;
import com.scalar.db.exception.storage.NoMutationException;
Expand Down Expand Up @@ -48,7 +33,7 @@
import org.junit.jupiter.api.TestInstance;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public abstract class StorageIntegrationTestBase {
public abstract class DistributedStorageIntegrationTestBase {

private static final String NAMESPACE = "integration_testing";
private static final String TABLE = "test_table";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
package com.scalar.db.storage;
package com.scalar.db.api;

import static org.assertj.core.api.Assertions.assertThat;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.ListMultimap;
import com.scalar.db.api.DistributedStorage;
import com.scalar.db.api.DistributedStorageAdmin;
import com.scalar.db.api.Put;
import com.scalar.db.api.Result;
import com.scalar.db.api.Scan;
import com.scalar.db.api.Scan.Ordering;
import com.scalar.db.api.Scan.Ordering.Order;
import com.scalar.db.api.Scanner;
import com.scalar.db.api.TableMetadata;
import com.scalar.db.config.DatabaseConfig;
import com.scalar.db.exception.storage.ExecutionException;
import com.scalar.db.io.DataType;
import com.scalar.db.io.Key;
import com.scalar.db.io.Value;
import com.scalar.db.service.StorageFactory;
import com.scalar.db.util.TestUtils;
import edu.umd.cs.findbugs.annotations.Nullable;
import java.io.IOException;
import java.util.ArrayList;
Expand All @@ -44,7 +38,7 @@
import org.junit.jupiter.api.TestInstance;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public abstract class StorageMultipleClusteringKeyScanIntegrationTestBase {
public abstract class DistributedStorageMultipleClusteringKeyScanIntegrationTestBase {

private enum OrderingType {
BOTH_SPECIFIED,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
package com.scalar.db.storage;
package com.scalar.db.api;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
import com.scalar.db.api.Delete;
import com.scalar.db.api.DistributedStorage;
import com.scalar.db.api.DistributedStorageAdmin;
import com.scalar.db.api.Get;
import com.scalar.db.api.Put;
import com.scalar.db.api.Result;
import com.scalar.db.api.TableMetadata;
import com.scalar.db.config.DatabaseConfig;
import com.scalar.db.exception.storage.ExecutionException;
import com.scalar.db.io.DataType;
import com.scalar.db.io.Key;
import com.scalar.db.io.Value;
import com.scalar.db.service.StorageFactory;
import com.scalar.db.util.TestUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -36,7 +30,7 @@
import org.junit.jupiter.api.TestInstance;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public abstract class StorageMultiplePartitionKeyIntegrationTestBase {
public abstract class DistributedStorageMultiplePartitionKeyIntegrationTestBase {

private static final String TEST_NAME = "mul_pkey";
private static final String NAMESPACE_BASE_NAME = "integration_testing_" + TEST_NAME + "_";
Expand Down
Loading