Skip to content

tests: remove ccm.scylla cli option #562

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

Merged
merged 1 commit into from
Jun 27, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ jobs:

- name: Run integration tests on Scylla (${{ steps.scylla-version.outputs.value }})
id: run-integration-tests
run: mvn -B verify -Dccm.version=${{ steps.scylla-version.outputs.value }} -Dccm.scylla=true -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
run: mvn -B verify -Dccm.version=${{ steps.scylla-version.outputs.value }} -Dccm.distribution=scylla -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true

- name: Copy test results
if: steps.run-integration-tests.outcome == 'failure'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.ccm.SchemaChangeSynchronizer;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.categories.ParallelizableTests;
import com.datastax.oss.driver.internal.core.cql.EmptyColumnDefinitions;
Expand Down Expand Up @@ -183,7 +184,8 @@ public void should_write() {

@Test
public void should_write_cas() {
assumeThat(CcmBridge.SCYLLA_ENABLEMENT).isFalse(); // @IntegrationTestDisabledScyllaFailure
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure

SimpleStatement statement =
SimpleStatement.builder(
Expand Down Expand Up @@ -243,7 +245,8 @@ public void should_write_cas() {

@Test
public void should_write_batch_cas() {
assumeThat(CcmBridge.SCYLLA_ENABLEMENT).isFalse(); // @IntegrationTestDisabledScyllaFailure
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure

BatchStatement batch = createCASBatch();
CqlSession session = sessionRule.session();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.datastax.oss.driver.api.testinfra.ScyllaRequirement;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.ccm.CustomCcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.api.testinfra.session.SessionUtils;
import java.nio.ByteBuffer;
Expand Down Expand Up @@ -76,7 +77,8 @@ public static void setup() {

@Test
public void should_use_only_one_node_when_lwt_detected() {
assumeTrue(CcmBridge.SCYLLA_ENABLEMENT); // Functionality only available in Scylla
assumeTrue(
CcmBridge.isDistributionOf(BackendType.SCYLLA)); // Functionality only available in Scylla
CqlSession session = SESSION_RULE.session();
int pk = 1234;
ByteBuffer routingKey = TypeCodecs.INT.encodePrimitive(pk, ProtocolVersion.DEFAULT);
Expand All @@ -97,7 +99,7 @@ public void should_use_only_one_node_when_lwt_detected() {
// Sanity check for the previous test - non-LWT queries should
// not always be sent to same node
public void should_not_use_only_one_node_when_non_lwt() {
assumeTrue(CcmBridge.SCYLLA_ENABLEMENT);
assumeTrue(CcmBridge.isDistributionOf(BackendType.SCYLLA));
CqlSession session = SESSION_RULE.session();
int pk = 1234;
PreparedStatement statement = session.prepare("INSERT INTO foo (pk, ck, v) VALUES (?, ?, ?)");
Expand All @@ -114,7 +116,8 @@ public void should_not_use_only_one_node_when_non_lwt() {

@Test
public void should_use_only_one_node_when_lwt_batch_detected() {
assumeTrue(CcmBridge.SCYLLA_ENABLEMENT); // Functionality only available in Scylla
assumeTrue(
CcmBridge.isDistributionOf(BackendType.SCYLLA)); // Functionality only available in Scylla
CqlSession session = SESSION_RULE.session();
int pk = 1234;
ByteBuffer routingKey = TypeCodecs.INT.encodePrimitive(pk, ProtocolVersion.DEFAULT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ public void should_handle_type_update() {
public void should_handle_view_creation() {
assumeThat(CCM_RULE.getCcmBridge().getCassandraVersion().compareTo(Version.V3_0_0) >= 0)
.isTrue();
assumeThat(CcmBridge.SCYLLA_ENABLEMENT).isFalse(); // @IntegrationTestDisabledScyllaFailure
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure
should_handle_creation(
"CREATE TABLE scores(user text, game text, score int, PRIMARY KEY (user, game))",
"CREATE MATERIALIZED VIEW highscores "
Expand Down Expand Up @@ -325,7 +326,7 @@ public void should_handle_view_update() {
public void should_handle_function_creation() {
assumeThat(CCM_RULE.getCcmBridge().getCassandraVersion().compareTo(Version.V2_2_0) >= 0)
.isTrue();
assumeThat(CcmBridge.SCYLLA_ENABLEMENT)
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUDF
should_handle_creation(
null,
Expand All @@ -351,7 +352,7 @@ public void should_handle_function_creation() {
public void should_handle_function_drop() {
assumeThat(CCM_RULE.getCcmBridge().getCassandraVersion().compareTo(Version.V2_2_0) >= 0)
.isTrue();
assumeThat(CcmBridge.SCYLLA_ENABLEMENT)
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUDF
should_handle_drop(
ImmutableList.of(
Expand All @@ -369,7 +370,7 @@ public void should_handle_function_drop() {
public void should_handle_function_update() {
assumeThat(CCM_RULE.getCcmBridge().getCassandraVersion().compareTo(Version.V2_2_0) >= 0)
.isTrue();
assumeThat(CcmBridge.SCYLLA_ENABLEMENT)
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUDF
should_handle_update_via_drop_and_recreate(
ImmutableList.of(
Expand All @@ -391,7 +392,7 @@ public void should_handle_function_update() {
public void should_handle_aggregate_creation() {
assumeThat(CCM_RULE.getCcmBridge().getCassandraVersion().compareTo(Version.V2_2_0) >= 0)
.isTrue();
assumeThat(CcmBridge.SCYLLA_ENABLEMENT)
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUDF
should_handle_creation(
"CREATE FUNCTION plus(i int, j int) RETURNS NULL ON NULL INPUT RETURNS int "
Expand Down Expand Up @@ -419,7 +420,7 @@ public void should_handle_aggregate_creation() {
public void should_handle_aggregate_drop() {
assumeThat(CCM_RULE.getCcmBridge().getCassandraVersion().compareTo(Version.V2_2_0) >= 0)
.isTrue();
assumeThat(CcmBridge.SCYLLA_ENABLEMENT)
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUDF
should_handle_drop(
ImmutableList.of(
Expand All @@ -438,7 +439,7 @@ public void should_handle_aggregate_drop() {
public void should_handle_aggregate_update() {
assumeThat(CCM_RULE.getCcmBridge().getCassandraVersion().compareTo(Version.V2_2_0) >= 0)
.isTrue();
assumeThat(CcmBridge.SCYLLA_ENABLEMENT)
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUDF
should_handle_update_via_drop_and_recreate(
ImmutableList.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.datastax.oss.driver.api.core.metadata.EndPoint;
import com.datastax.oss.driver.api.core.metadata.Node;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionUtils;
import java.net.InetAddress;
import java.net.InetSocketAddress;
Expand All @@ -31,7 +32,7 @@ public void checkScyllaVersion() {
// Zero-token nodes introduced in scylladb/scylladb#19684
// 2025.1 is an estimated future version and it still may not have this change in.
// This number may need to be adjusted once CI picks up this test.
assumeTrue(CcmBridge.SCYLLA_ENABLEMENT);
assumeTrue(CcmBridge.isDistributionOf(BackendType.SCYLLA));
if (CcmBridge.SCYLLA_ENTERPRISE) {
assumeTrue(
CcmBridge.VERSION.compareTo(Objects.requireNonNull(Version.parse("2025.1.0"))) >= 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.datastax.oss.driver.api.mapper.entity.saving.NullSavingStrategy;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.categories.ParallelizableTests;
import com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures;
Expand Down Expand Up @@ -229,7 +230,8 @@ public void should_insert_entity_with_bound_timestamp_asynchronously() {

@Test
public void should_insert_entity_if_not_exists() {
assumeThat(CcmBridge.SCYLLA_ENABLEMENT).isFalse(); // @IntegrationTestDisabledScyllaFailure
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure
assertThat(dao.saveIfNotExists(FLAMETHROWER)).isNull();

Product otherProduct =
Expand All @@ -248,7 +250,8 @@ public void should_insert_entity_if_not_exists_returning_boolean() {

@Test
public void should_insert_entity_if_not_exists_asynchronously() {
assumeThat(CcmBridge.SCYLLA_ENABLEMENT).isFalse(); // @IntegrationTestDisabledScyllaFailure
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure
assertThat(CompletableFutures.getUninterruptibly(dao.saveAsyncIfNotExists(FLAMETHROWER)))
.isNull();

Expand All @@ -275,7 +278,8 @@ public void should_insert_entity_if_not_exists_asynchronously_returning_boolean(

@Test
public void should_insert_entity_if_not_exists_returning_optional() {
assumeThat(CcmBridge.SCYLLA_ENABLEMENT).isFalse(); // @IntegrationTestDisabledScyllaFailure
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure
assertThat(dao.saveIfNotExistsOptional(FLAMETHROWER)).isEmpty();

Product otherProduct =
Expand All @@ -285,7 +289,8 @@ public void should_insert_entity_if_not_exists_returning_optional() {

@Test
public void should_insert_entity_if_not_exists_returning_optional_asynchronously() {
assumeThat(CcmBridge.SCYLLA_ENABLEMENT).isFalse(); // @IntegrationTestDisabledScyllaFailure
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure
assertThat(
CompletableFutures.getUninterruptibly(dao.saveAsyncIfNotExistsOptional(FLAMETHROWER)))
.isEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ protected static boolean isSasiBroken(BaseCcmRule ccmRule) {

protected static boolean supportsSASI(BaseCcmRule ccmRule) {
return ccmRule.getCassandraVersion().compareTo(MINIMUM_SASI_VERSION) >= 0
&& !CcmBridge
.SCYLLA_ENABLEMENT /* @IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaUnsupportedIndex */;
&& !CcmBridge.isDistributionOf(
BackendType
.SCYLLA) /* @IntegrationTestDisabledScyllaFailure @IntegrationTestDisabledScyllaUnsupportedFunctionality @IntegrationTestDisabledScyllaUnsupportedIndex */;
}

@Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ public void should_log_warn_when_entity_has_no_corresponding_cql_table() {

@Test
public void should_throw_general_driver_exception_when_schema_validation_check_is_disabled() {
assumeThat(CcmBridge.SCYLLA_ENABLEMENT).isFalse(); // @IntegrationTestDisabledScyllaFailure
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure
// @IntegrationTestDisabledScyllaDifferentText
assertThatThrownBy(
() -> mapperDisabledValidation.productDaoValidationDisabled(sessionRule.keyspace()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public void should_select_with_limit() {

@Test
public void should_select_with_per_partition_limit() {
assumeThat(CcmBridge.SCYLLA_ENABLEMENT).isFalse(); // @IntegrationTestDisabledScyllaFailure
assumeThat(CcmBridge.isDistributionOf(BackendType.SCYLLA))
.isFalse(); // @IntegrationTestDisabledScyllaFailure

PagingIterable<Simple> elements = dao.selectWithPerPartitionLimit(5);
assertThat(elements.isFullyFetched()).isTrue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.datastax.oss.driver.api.testinfra.ScyllaRequirement;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.requirement.BackendRequirementRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import java.util.Objects;
import java.util.Optional;
import org.junit.AssumptionViolatedException;
Expand Down Expand Up @@ -110,11 +111,11 @@ private void fireRequirementsNotMet(
String.format(
"Test requires %s %s %s but %s is configured. Description: %s",
lessThan ? "less than" : "at least",
dse ? "DSE" : (CcmBridge.SCYLLA_ENABLEMENT ? "SCYLLA" : "C*"),
dse ? "DSE" : (CcmBridge.isDistributionOf(BackendType.SCYLLA) ? "SCYLLA" : "C*"),
requirement,
dse
? CCM_BRIDGE.getDseVersion().orElse(null)
: (CcmBridge.SCYLLA_ENABLEMENT
: (CcmBridge.isDistributionOf(BackendType.SCYLLA)
? CCM_BRIDGE.getScyllaVersion().orElse(null)
: CCM_BRIDGE.getCassandraVersion()),
description));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ public void evaluate() {
String.format(
"Test requires %s %s %s but %s is configured. Description: %s",
lessThan ? "less than" : "at least",
dse ? "DSE" : (CcmBridge.SCYLLA_ENABLEMENT ? "SCYLLA" : "C*"),
dse ? "DSE" : (CcmBridge.isDistributionOf(BackendType.SCYLLA) ? "SCYLLA" : "C*"),
requirement,
dse
? ccmBridge.getDseVersion().orElse(null)
: (CcmBridge.SCYLLA_ENABLEMENT
: (CcmBridge.isDistributionOf(BackendType.SCYLLA)
? ccmBridge.getScyllaVersion().orElse(null)
: ccmBridge.getCassandraVersion()),
description));
Expand All @@ -97,7 +97,7 @@ public Statement apply(Statement base, Description description) {
// Scylla-specific annotations
ScyllaSkip scyllaSkip = description.getAnnotation(ScyllaSkip.class);
if (scyllaSkip != null) {
if (CcmBridge.SCYLLA_ENABLEMENT) {
if (CcmBridge.isDistributionOf(BackendType.SCYLLA)) {
return new Statement() {

@Override
Expand All @@ -112,7 +112,7 @@ public void evaluate() {

CassandraSkip cassandraSkip = description.getAnnotation(CassandraSkip.class);
if (cassandraSkip != null) {
if (!CcmBridge.SCYLLA_ENABLEMENT) {
if (!CcmBridge.isDistributionOf(BackendType.SCYLLA)) {
return new Statement() {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ public class CcmBridge implements AutoCloseable {
BackendType.valueOf(
System.getProperty("ccm.distribution", BackendType.CASSANDRA.name()).toUpperCase());

public static final Boolean SCYLLA_ENABLEMENT = Boolean.getBoolean("ccm.scylla");

public static final String CCM_VERSION_PROPERTY = System.getProperty("ccm.version", "4.0.0");

public static final Version VERSION = Objects.requireNonNull(parseCcmVersion());
Expand Down Expand Up @@ -150,13 +148,8 @@ public class CcmBridge implements AutoCloseable {

static {
Map<String, String> envMap = Maps.newHashMap(new ProcessBuilder().environment());
if (SCYLLA_ENABLEMENT) {
LOG.debug("Overriding distribution variable because 'ccm.scylla = true' was passed");
DISTRIBUTION = BackendType.SCYLLA;

if (SCYLLA_ENTERPRISE) {
envMap.put("SCYLLA_PRODUCT", "enterprise");
}
if (isDistributionOf(BackendType.SCYLLA) && SCYLLA_ENTERPRISE) {
envMap.put("SCYLLA_PRODUCT", "enterprise");
}
LOG.info("CCM Bridge configured with {} version {}", DISTRIBUTION.getFriendlyName(), VERSION);

Expand Down Expand Up @@ -260,7 +253,9 @@ private static Version parseCcmVersion() {
CommandLine.parse(
String.format(
"ccm create get_version -n 1 %s --version %s --config-dir=%s",
(SCYLLA_ENABLEMENT ? "--scylla" : " "), versionString, configDir)));
(isDistributionOf(BackendType.SCYLLA) ? "--scylla" : " "),
versionString,
configDir)));
String output =
execute(
CommandLine.parse(
Expand All @@ -281,11 +276,13 @@ private static Version parseCcmVersion() {
}

public Optional<Version> getScyllaVersion() {
return SCYLLA_ENABLEMENT ? Optional.of(VERSION) : Optional.empty();
return isDistributionOf(BackendType.SCYLLA) ? Optional.of(VERSION) : Optional.empty();
}

public Optional<String> getScyllaUnparsedVersion() {
return SCYLLA_ENABLEMENT ? Optional.of(System.getProperty("ccm.version")) : Optional.empty();
return isDistributionOf(BackendType.SCYLLA)
? Optional.of(System.getProperty("ccm.version"))
: Optional.empty();
}

public Optional<Version> getDseVersion() {
Expand Down Expand Up @@ -321,7 +318,7 @@ private String getCcmVersionString(String propertyString) {
// If parseCcmVersion has not failed execution it should be usable.
return propertyString;
}
if (SCYLLA_ENABLEMENT) {
if (isDistributionOf(BackendType.SCYLLA)) {
// Scylla OSS versions before 5.1 had RC versioning scheme of 5.0.rc3.
// Scylla OSS versions after (and including 5.1) have RC versioning of 5.1.0-rc3.
// A similar situation occurs with Scylla Enterprise after 2022.2.
Expand Down Expand Up @@ -382,7 +379,8 @@ public void create() {

Version cassandraVersion = getCassandraVersion();

if (cassandraVersion.compareTo(Version.V2_2_0) >= 0 && !SCYLLA_ENABLEMENT) {
if (cassandraVersion.compareTo(Version.V2_2_0) >= 0
&& !isDistributionOf(BackendType.SCYLLA)) {
// @IntegrationTestDisabledScyllaJVMArgs @IntegrationTestDisabledScyllaUDF
cassandraConfiguration.put("enable_user_defined_functions", "true");
}
Expand Down Expand Up @@ -723,7 +721,7 @@ public Builder withCreateOption(String option) {
/** Enables SSL encryption. */
public Builder withSsl() {
cassandraConfiguration.put("client_encryption_options.enabled", "true");
if (SCYLLA_ENABLEMENT) {
if (isDistributionOf(BackendType.SCYLLA)) {
cassandraConfiguration.put(
"client_encryption_options.certificate",
DEFAULT_SERVER_CERT_CHAIN_FILE.getAbsolutePath());
Expand Down Expand Up @@ -756,7 +754,7 @@ public Builder withSslLocalhostCn() {
public Builder withSslAuth() {
withSsl();
cassandraConfiguration.put("client_encryption_options.require_client_auth", "true");
if (SCYLLA_ENABLEMENT) {
if (isDistributionOf(BackendType.SCYLLA)) {
cassandraConfiguration.put(
"client_encryption_options.truststore",
DEFAULT_SERVER_TRUSTSTORE_PEM_FILE.getAbsolutePath());
Expand Down
Loading