Skip to content

CSHARP-1019: Add support for C* 4.1, DSE 6.9.x, and HCD releases to CI #615

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 25 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
33 changes: 23 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,26 @@ CCM_CASSANDRA_VERSION=${DSE_FIXED_VERSION} # maintain for backwards compatibilit
CCM_VERSION=${DSE_FIXED_VERSION}
CCM_SERVER_TYPE=dse
DSE_VERSION=${DSE_FIXED_VERSION}
CCM_IS_DSE=true
CCM_DISTRIBUTION=dse
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's another Jenkinsfile that needs this changes too probably. That jenkinsfile is responsible for daily/weekly builds.

CASSANDRA_VERSION=${DSE_FIXED_VERSION}
CCM_BRANCH=${DSE_FIXED_VERSION}
DSE_BRANCH=${DSE_FIXED_VERSION}
JDK=1.8
ENVIRONMENT_EOF
'''
}

if (env.SERVER_VERSION.split('-')[0] == 'hcd') {
env.HCD_FIXED_VERSION = env.SERVER_VERSION.split('-')[1]
sh label: 'Update environment for HCD', script: '''#!/bin/bash -le
cat >> ${HOME}/environment.txt << ENVIRONMENT_EOF
CCM_PATH=${HOME}/ccm
CCM_CASSANDRA_VERSION=${HCD_FIXED_VERSION} # maintain for backwards compatibility
CASSANDRA_VERSION=${HCD_FIXED_VERSION}
CCM_DISTRIBUTION=hcd
ENVIRONMENT_EOF
'''
}

if (env.SERVER_VERSION == env.SERVER_VERSION_SNI && env.DOTNET_VERSION != 'mono') {
sh label: 'Update environment for SNI proxy tests', script: '''#!/bin/bash -le
Expand Down Expand Up @@ -432,13 +445,13 @@ pipeline {
axes {
axis {
name 'SERVER_VERSION'
values '3.0', // latest 3.0.x Apache Cassandra�
'3.11', // latest 3.11.x Apache Cassandra�
'4.0', // latest 4.0.x Apache Cassandra�
'5.0-beta1', // Development Apache Cassandra�
values '3.11', // latest 3.11.x Apache Cassandra�
'4.1', // latest 4.x Apache Cassandra�
'5.0', // Development Apache Cassandra�
'dse-5.1.35', // latest 5.1.x DataStax Enterprise
'dse-6.7.17', // latest 6.7.x DataStax Enterprise
'dse-6.8.30' // 6.8 current DataStax Enterprise
'dse-6.8.30', // latest 6.7.x DataStax Enterprise
'dse-6.9.3', // latest DataStax Enterprise
'hcd-1.0.0' // Hyper-Converged Database
}
axis {
name 'DOTNET_VERSION'
Expand All @@ -449,11 +462,11 @@ pipeline {
exclude {
axis {
name 'DOTNET_VERSION'
values 'mono', 'net8'
values 'mono'
}
axis {
name 'SERVER_VERSION'
values '3.0', '5.0-beta1', 'dse-5.1.35', 'dse-6.8.30'
values '3.11', '4.1', 'dse-5.1.35', 'dse-6.8.30'
}
}
exclude {
Expand All @@ -463,7 +476,7 @@ pipeline {
}
axis {
name 'SERVER_VERSION'
values 'dse-6.7.17', '3.11'
values '3.11', '5.0', 'dse-6.9.3', 'hcd-1.0.0'
}
}
}
Expand Down
56 changes: 39 additions & 17 deletions Jenkinsfile.scheduled
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,26 @@ CCM_CASSANDRA_VERSION=${DSE_FIXED_VERSION} # maintain for backwards compatibilit
CCM_VERSION=${DSE_FIXED_VERSION}
CCM_SERVER_TYPE=dse
DSE_VERSION=${DSE_FIXED_VERSION}
CCM_IS_DSE=true
CCM_DISTRIBUTION=dse
CASSANDRA_VERSION=${DSE_FIXED_VERSION}
CCM_BRANCH=${DSE_FIXED_VERSION}
DSE_BRANCH=${DSE_FIXED_VERSION}
JDK=1.8
ENVIRONMENT_EOF
'''
}

if (env.SERVER_VERSION.split('-')[0] == 'hcd') {
env.HCD_FIXED_VERSION = env.SERVER_VERSION.split('-')[1]
sh label: 'Update environment for HCD', script: '''#!/bin/bash -le
cat >> ${HOME}/environment.txt << ENVIRONMENT_EOF
CCM_PATH=${HOME}/ccm
CCM_CASSANDRA_VERSION=${HCD_FIXED_VERSION} # maintain for backwards compatibility
CASSANDRA_VERSION=${HCD_FIXED_VERSION}
CCM_DISTRIBUTION=hcd
ENVIRONMENT_EOF
'''
}

if (env.SERVER_VERSION == env.SERVER_VERSION_SNI && env.DOTNET_VERSION != 'mono') {
sh label: 'Update environment for SNI proxy tests', script: '''#!/bin/bash -le
Expand Down Expand Up @@ -465,12 +478,15 @@ pipeline {
'2.2', // Legacy Apache Cassandra�
'3.0', // Previous Apache Cassandra�
'3.11', // latest 3.11.x Apache Cassandra�
'4.0', // latest 4.0.x Apache Cassandra�
'5.0-beta1', // Development Apache Cassandra�
'4.0', // Previous 4.0.x Apache Cassandra�
'4.1', // Latest 4.1.x Apache Cassandra�
'5.0', // Development Apache Cassandra�
'dse-5.1.35', // Legacy DataStax Enterprise
'dse-6.0.18', // Previous DataStax Enterprise
'dse-6.7.17', // Current DataStax Enterprise
'dse-6.8.30' // Current DataStax Enterprise
'dse-6.7.17', // Previous DataStax Enterprise
'dse-6.8.30', // Previous DataStax Enterprise
'dse-6.9.3', // Latest DataStax Enterprise
'hcd-1.0.0' // Hyper-Converged Database
}
axis {
name 'DOTNET_VERSION'
Expand All @@ -495,7 +511,7 @@ pipeline {
}
axis {
name 'SERVER_VERSION'
values '2.1', '2.2', '3.0', '5.0-beta1', 'dse-5.1.35', 'dse-6.0.18'
values '2.1', '2.2', '3.0', '5.0', 'dse-5.1.35', 'dse-6.0.18'
}
}
exclude {
Expand Down Expand Up @@ -593,8 +609,9 @@ pipeline {
values '2.1', // Legacy Apache Cassandra�
'2.2', // Legacy Apache Cassandra�
'3.11', // latest 3.11.x Apache Cassandra�
'4.0' // latest 4.0.x Apache Cassandra�
'5.0-beta1' // Development Apache Cassandra�
'4.0', // latest 4.0.x Apache Cassandra�
'4.1', // latest 4.1.x Apache Cassandra�
'5.0' // Development Apache Cassandra�
}
axis {
name 'DOTNET_VERSION'
Expand Down Expand Up @@ -629,7 +646,7 @@ pipeline {
}
axis {
name 'SERVER_VERSION'
values '2.1', '2.2', '5.0-beta1'
values '2.1', '2.2', '5.0'
}
}
}
Expand Down Expand Up @@ -707,13 +724,17 @@ pipeline {
name 'SERVER_VERSION'
values '2.1', // Legacy Apache Cassandra�
'2.2', // Legacy Apache Cassandra�
'3.0', // Previous Apache Cassandra�
'3.11', // latest 3.11.x Apache Cassandra�
'4.0', // latest 4.0.x Apache Cassandra�
'5.0-beta1', // latest 4.0.x Apache Cassandra�
'4.0', // Previous 4.0.x Apache Cassandra�
'4.1', // Latest 4.1.x Apache Cassandra�
'5.0', // Development Apache Cassandra�
'dse-5.1.35', // Legacy DataStax Enterprise
'dse-6.0.18', // Previous DataStax Enterprise
'dse-6.7.17', // Current DataStax Enterprise
'dse-6.8.30' // Current DataStax Enterprise
'dse-6.7.17', // Previous DataStax Enterprise
'dse-6.8.30', // Previous DataStax Enterprise
'dse-6.9.3', // Latest DataStax Enterprise
'hcd-1.0.0' // Hyper-Converged Database
}
axis {
name 'DOTNET_VERSION'
Expand All @@ -728,7 +749,7 @@ pipeline {
}
axis {
name 'SERVER_VERSION'
values '2.1', '2.2', 'dse-6.0.18', 'dse-5.1.35', '5.0-beta1'
values '2.1', '2.2', 'dse-6.0.18', 'dse-5.1.35', '5.0'
}
}
exclude {
Expand Down Expand Up @@ -817,8 +838,9 @@ pipeline {
values '2.1', // Legacy Apache Cassandra�
'2.2', // Legacy Apache Cassandra�
'3.11', // latest 3.11.x Apache Cassandra�
'4.0' // latest 4.0.x Apache Cassandra�
'5.0-beta1' // Development Apache Cassandra�
'4.0', // latest 4.0.x Apache Cassandra�
'4.1', // latest 4.1.x Apache Cassandra�
'5.0' // Development Apache Cassandra�
}
axis {
name 'DOTNET_VERSION'
Expand All @@ -833,7 +855,7 @@ pipeline {
}
axis {
name 'SERVER_VERSION'
values '2.1', '5.0-beta1'
values '2.1', '5.0'
}
}
exclude {
Expand Down
2 changes: 1 addition & 1 deletion src/Cassandra.IntegrationTests/Core/PagingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void Should_PagingOnBoundStatement_When_ReceivedNumberOfRowsIsOne()
}

[Test]
[TestCassandraVersion(4, 0)]
[TestBothServersVersion(4, 0, 6, 0)]
public void Should_PagingOnBoundStatement_When_NewResultMetadataIsSet()
{
if (Session.Cluster.Metadata.ControlConnection.Serializer.CurrentProtocolVersion < ProtocolVersion.V5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ protected override string[] SetupQueries
}
};

if (TestClusterManager.CheckCassandraVersion(false, new Version(4, 0), Comparison.LessThan))
// COMPACT STORAGE is not supported by DSE 6.0 / C* 4.0.
if (TestClusterManager.CheckCassandraVersion(true, new Version(4, 0), Comparison.LessThan) ||
(TestClusterManager.IsDse && TestClusterManager.CheckDseVersion(new Version(6, 0), Comparison.LessThan)))
{
setupQueries.Add($"CREATE TABLE {TableCompactStorage} (key blob PRIMARY KEY, bar int, baz uuid)" +
$" WITH COMPACT STORAGE");
Expand Down Expand Up @@ -517,7 +519,7 @@ public void SimpleStatement_Dictionary_Parameters_CaseInsensitivity_ExcessOfPara
}

[Test]
[TestCassandraVersion(4, 0)]
[TestBothServersVersion(4, 0, 6, 0)]
public void SimpleStatement_With_Keyspace_Defined_On_Protocol_Greater_Than_4()
{
if (Session.Cluster.Metadata.ControlConnection.Serializer.CurrentProtocolVersion < ProtocolVersion.V5)
Expand All @@ -535,7 +537,7 @@ public void SimpleStatement_With_Keyspace_Defined_On_Protocol_Greater_Than_4()
}

[Test]
[TestCassandraVersion(4, 0, Comparison.LessThan)]
[TestBothServersVersion(4, 0, 5,1, Comparison.LessThan)]
public void SimpleStatement_With_Keyspace_Defined_On_Lower_Protocol_Versions()
{
// It should fail as the keyspace from the session will be used
Expand All @@ -547,9 +549,11 @@ public void SimpleStatement_With_Keyspace_Defined_On_Lower_Protocol_Versions()
[TestCassandraVersion(3, 11)]
public void SimpleStatement_With_No_Compact_Enabled_Should_Reveal_Non_Schema_Columns()
{
if (TestClusterManager.CheckCassandraVersion(false, new Version(4, 0), Comparison.GreaterThanOrEqualsTo))
if (TestClusterManager.CheckCassandraVersion(true, new Version(4, 0), Comparison.GreaterThanOrEqualsTo) ||
(TestClusterManager.IsDse && TestClusterManager.CheckDseVersion(new Version(6, 0), Comparison.GreaterThanOrEqualsTo)) ||
TestClusterManager.IsHcd)
{
Assert.Ignore("COMPACT STORAGE is only supported by C* versions prior to 4.0");
Assert.Ignore("COMPACT STORAGE is not supported by DSE 6.0 / C* 4.0");
return;
}

Expand All @@ -568,9 +572,11 @@ public void SimpleStatement_With_No_Compact_Enabled_Should_Reveal_Non_Schema_Col
[TestCassandraVersion(3, 11)]
public void SimpleStatement_With_No_Compact_Disabled_Should_Not_Reveal_Non_Schema_Columns()
{
if (TestClusterManager.CheckCassandraVersion(false, new Version(4, 0), Comparison.GreaterThanOrEqualsTo))
if (TestClusterManager.CheckCassandraVersion(true, new Version(4, 0), Comparison.GreaterThanOrEqualsTo) ||
(TestClusterManager.IsDse && TestClusterManager.CheckDseVersion(new Version(6, 0), Comparison.GreaterThanOrEqualsTo)) ||
TestClusterManager.IsHcd)
{
Assert.Ignore("COMPACT STORAGE is only supported by C* versions prior to 4.0");
Assert.Ignore("COMPACT STORAGE is not supported by DSE 6.0 / C* 4.0");
return;
}

Expand Down
12 changes: 6 additions & 6 deletions src/Cassandra.IntegrationTests/Core/PreparedStatementsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ public void Bound_TinyInt_Tests()

[TestCase(true)]
[TestCase(false)]
[TestCassandraVersion(4, 0)]
[TestBothServersVersion(4,0,5,1)]
public void Session_Prepare_With_Keyspace_Defined_On_Protocol_Greater_Than_4(bool usePayload)
{
if (Session.Cluster.Metadata.ControlConnection.Serializer.CurrentProtocolVersion < ProtocolVersion.V5)
Expand Down Expand Up @@ -858,7 +858,7 @@ public void Session_Prepare_With_Keyspace_Defined_On_Protocol_Greater_Than_4(boo

[TestCase(true)]
[TestCase(false)]
[TestCassandraVersion(4, 0)]
[TestBothServersVersion(4,0,5,1)]
public async Task Session_PrepareAsync_With_Keyspace_Defined_On_Protocol_Greater_Than_4(bool usePayload)
{
if (Session.Cluster.Metadata.ControlConnection.Serializer.CurrentProtocolVersion < ProtocolVersion.V5)
Expand Down Expand Up @@ -891,14 +891,14 @@ await TestHelper.TimesLimit(async () =>
}

[Test]
[TestCassandraVersion(4, 0)]
[TestBothServersVersion(4,0,5,1)]
public void Session_Prepare_With_Keyspace_Defined_On_Protocol_V4()
{
TestKeyspaceInPrepareNotSupported(true);
}

[Test]
[TestCassandraVersion(4, 0, Comparison.LessThan)]
[TestBothServersVersion(4, 0, 5,1, Comparison.LessThan)]
public void Session_Prepare_With_Keyspace_Defined_On_Previuos_Cassandra_Versions()
{
TestKeyspaceInPrepareNotSupported(false);
Expand Down Expand Up @@ -1085,7 +1085,7 @@ public void Batch_PreparedStatements_NotSupportedInC1_2()
}

[Test]
[TestCassandraVersion(4, 0)]
[TestBothServersVersion(4,0,5,1)]
public void BatchStatement_With_Keyspace_Defined_On_Protocol_Greater_Than_4()
{
using (var cluster = ClusterBuilder().AddContactPoint(TestClusterManager.InitialContactPoint).Build())
Expand All @@ -1111,7 +1111,7 @@ public void BatchStatement_With_Keyspace_Defined_On_Protocol_Greater_Than_4()
}

[Test]
[TestCassandraVersion(4, 0, Comparison.LessThan)]
[TestBothServersVersion(4, 0, 5,1, Comparison.LessThan)]
public void BatchStatement_With_Keyspace_Defined_On_Lower_Protocol_Versions()
{
using (var cluster = ClusterBuilder().AddContactPoint(TestClusterManager.InitialContactPoint).Build())
Expand Down
13 changes: 6 additions & 7 deletions src/Cassandra.IntegrationTests/Core/SchemaMetadataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ public SchemaMetadataTests() :
base(() =>
{
string[] cassandraYaml = null;
if (TestClusterManager.CheckCassandraVersion(true, new Version(5, 0), Comparison.GreaterThanOrEqualsTo))
{
cassandraYaml = new[] { "materialized_views_enabled: true" };
}
else if (TestClusterManager.CheckCassandraVersion(true, new Version(4, 0), Comparison.GreaterThanOrEqualsTo))
if (TestClusterManager.CheckCassandraVersion(true, new Version(4, 0), Comparison.GreaterThanOrEqualsTo) ||
TestClusterManager.IsHcd)
{
cassandraYaml = new[] { "enable_materialized_views: true" };
}
Expand Down Expand Up @@ -664,11 +661,13 @@ public void RaiseErrorOnInvalidMultipleSecondaryIndexTest(bool metadataSync)
[Test, TestCase(true), TestCase(false), TestCassandraVersion(3, 0)]
public void ColumnClusteringOrderReversedTest(bool metadataSync)
{
if (TestClusterManager.CheckCassandraVersion(false, new Version(4, 0), Comparison.GreaterThanOrEqualsTo))
if (TestClusterManager.CheckCassandraVersion(true, new Version(4, 0), Comparison.GreaterThanOrEqualsTo) ||
(TestClusterManager.IsDse && TestClusterManager.CheckDseVersion(new Version(6, 0), Comparison.GreaterThanOrEqualsTo)))
{
Assert.Ignore("Compact table test designed for C* 3.0");
Assert.Ignore("COMPACT STORAGE is not supported by DSE 6.0 / C* 4.0");
return;
}

var keyspaceName = TestUtils.GetUniqueKeyspaceName();
var tableName = TestUtils.GetUniqueTableName().ToLower();
var cluster = GetNewTemporaryCluster(builder => builder.WithMetadataSyncOptions(new MetadataSyncOptions().SetMetadataSyncEnabled(metadataSync)));
Expand Down
Loading