Skip to content

Commit 2977525

Browse files
authored
CSHARP-1013 Add C* 5.0-beta1 to driver test matrix (#609)
1 parent 8fb0053 commit 2977525

File tree

9 files changed

+93
-34
lines changed

9 files changed

+93
-34
lines changed

Jenkinsfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,10 @@ pipeline {
432432
axes {
433433
axis {
434434
name 'SERVER_VERSION'
435-
values '2.2', // latest 2.2.x Apache Cassandra�
436-
'3.0', // latest 3.0.x Apache Cassandra�
435+
values '3.0', // latest 3.0.x Apache Cassandra�
437436
'3.11', // latest 3.11.x Apache Cassandra�
438-
'4.0', // Development Apache Cassandra�
437+
'4.0', // latest 4.0.x Apache Cassandra�
438+
'5.0-beta1', // Development Apache Cassandra�
439439
'dse-5.1.35', // latest 5.1.x DataStax Enterprise
440440
'dse-6.7.17', // latest 6.7.x DataStax Enterprise
441441
'dse-6.8.30' // 6.8 current DataStax Enterprise
@@ -453,7 +453,7 @@ pipeline {
453453
}
454454
axis {
455455
name 'SERVER_VERSION'
456-
values '2.2', '3.0', 'dse-5.1.35', 'dse-6.8.30'
456+
values '3.0', '5.0-beta1', 'dse-5.1.35', 'dse-6.8.30'
457457
}
458458
}
459459
exclude {

Jenkinsfile.scheduled

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,9 @@ pipeline {
464464
values '2.1', // Legacy Apache Cassandra�
465465
'2.2', // Legacy Apache Cassandra�
466466
'3.0', // Previous Apache Cassandra�
467-
'3.11', // Current Apache Cassandra�
468-
'4.0', // Development Apache Cassandra�
467+
'3.11', // latest 3.11.x Apache Cassandra�
468+
'4.0', // latest 4.0.x Apache Cassandra�
469+
'5.0-beta1', // Development Apache Cassandra�
469470
'dse-5.1.35', // Legacy DataStax Enterprise
470471
'dse-6.0.18', // Previous DataStax Enterprise
471472
'dse-6.7.17', // Current DataStax Enterprise
@@ -494,7 +495,7 @@ pipeline {
494495
}
495496
axis {
496497
name 'SERVER_VERSION'
497-
values '2.1', '2.2', '3.0', 'dse-5.1.35', 'dse-6.0.18'
498+
values '2.1', '2.2', '3.0', '5.0-beta1', 'dse-5.1.35', 'dse-6.0.18'
498499
}
499500
}
500501
exclude {
@@ -591,8 +592,9 @@ pipeline {
591592
name 'SERVER_VERSION'
592593
values '2.1', // Legacy Apache Cassandra�
593594
'2.2', // Legacy Apache Cassandra�
594-
'3.11', // Current Apache Cassandra�
595-
'4.0' // Development Apache Cassandra�
595+
'3.11', // latest 3.11.x Apache Cassandra�
596+
'4.0' // latest 4.0.x Apache Cassandra�
597+
'5.0-beta1' // Development Apache Cassandra�
596598
}
597599
axis {
598600
name 'DOTNET_VERSION'
@@ -627,7 +629,7 @@ pipeline {
627629
}
628630
axis {
629631
name 'SERVER_VERSION'
630-
values '2.1', '2.2', '4.0'
632+
values '2.1', '2.2', '5.0-beta1'
631633
}
632634
}
633635
}
@@ -705,8 +707,9 @@ pipeline {
705707
name 'SERVER_VERSION'
706708
values '2.1', // Legacy Apache Cassandra�
707709
'2.2', // Legacy Apache Cassandra�
708-
'3.11', // Current Apache Cassandra�
709-
'4.0', // Development Apache Cassandra�
710+
'3.11', // latest 3.11.x Apache Cassandra�
711+
'4.0', // latest 4.0.x Apache Cassandra�
712+
'5.0-beta1', // latest 4.0.x Apache Cassandra�
710713
'dse-5.1.35', // Legacy DataStax Enterprise
711714
'dse-6.0.18', // Previous DataStax Enterprise
712715
'dse-6.7.17', // Current DataStax Enterprise
@@ -725,7 +728,7 @@ pipeline {
725728
}
726729
axis {
727730
name 'SERVER_VERSION'
728-
values '2.1', '2.2', 'dse-6.0.18', 'dse-5.1.35'
731+
values '2.1', '2.2', 'dse-6.0.18', 'dse-5.1.35', '5.0-beta1'
729732
}
730733
}
731734
exclude {
@@ -813,8 +816,9 @@ pipeline {
813816
name 'SERVER_VERSION'
814817
values '2.1', // Legacy Apache Cassandra�
815818
'2.2', // Legacy Apache Cassandra�
816-
'3.11', // Current Apache Cassandra�
817-
'4.0' // Development Apache Cassandra�
819+
'3.11', // latest 3.11.x Apache Cassandra�
820+
'4.0' // latest 4.0.x Apache Cassandra�
821+
'5.0-beta1' // Development Apache Cassandra�
818822
}
819823
axis {
820824
name 'DOTNET_VERSION'
@@ -829,7 +833,7 @@ pipeline {
829833
}
830834
axis {
831835
name 'SERVER_VERSION'
832-
values '2.1'
836+
values '2.1', '5.0-beta1'
833837
}
834838
}
835839
exclude {

src/Cassandra.IntegrationTests/Core/ClientWarningsTests.cs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,27 @@ public void SetupFixture()
4545
return;
4646
}
4747

48+
string[] cassandraYaml = null;
49+
if (TestClusterManager.CheckCassandraVersion(true, Version.Parse("5.0"), Comparison.GreaterThanOrEqualsTo))
50+
{
51+
cassandraYaml = new[]
52+
{
53+
"batch_size_warn_threshold:5KiB",
54+
"batch_size_fail_threshold:50KiB"
55+
};
56+
}
57+
else
58+
{
59+
cassandraYaml = new[]
60+
{
61+
"batch_size_warn_threshold_in_kb:5",
62+
"batch_size_fail_threshold_in_kb:50"
63+
};
64+
}
65+
4866
_testCluster = TestClusterManager.CreateNew(1, new TestClusterOptions
4967
{
50-
CassandraYaml = new[]
51-
{
52-
"batch_size_warn_threshold_in_kb:5",
53-
"batch_size_fail_threshold_in_kb:50"
54-
},
68+
CassandraYaml = cassandraYaml,
5569
//Using a mirroring handler, the server will reply providing the same payload that was sent
5670
JvmArgs = new[] { "-Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler" }
5771
});

src/Cassandra.IntegrationTests/Core/SchemaMetadataTests.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,23 @@ namespace Cassandra.IntegrationTests.Core
3030
[TestFixture, Category(TestCategory.Short), Category(TestCategory.RealCluster), Category(TestCategory.ServerApi)]
3131
public class SchemaMetadataTests : SharedClusterTest
3232
{
33-
public SchemaMetadataTests() :
34-
base(1, true, new TestClusterOptions
33+
public SchemaMetadataTests() :
34+
base(() =>
3535
{
36-
CassandraYaml =
37-
TestClusterManager.CheckCassandraVersion(true, new Version(4, 0), Comparison.GreaterThanOrEqualsTo )
38-
? new[] { "enable_materialized_views: true" } : new string[0]
39-
})
36+
string[] cassandraYaml = null;
37+
if (TestClusterManager.CheckCassandraVersion(true, new Version(5, 0), Comparison.GreaterThanOrEqualsTo))
38+
{
39+
cassandraYaml = new[] { "materialized_views_enabled: true" };
40+
}
41+
else if (TestClusterManager.CheckCassandraVersion(true, new Version(4, 0), Comparison.GreaterThanOrEqualsTo))
42+
{
43+
cassandraYaml = new[] { "enable_materialized_views: true" };
44+
}
45+
return new TestClusterOptions
46+
{
47+
CassandraYaml = cassandraYaml
48+
};
49+
}, 1, true)
4050
{
4151
}
4252

src/Cassandra.IntegrationTests/Core/TimeUuidSerializationTests.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,24 @@ public class TimeUuidSerializationTests : SharedClusterTest
3838
$"CREATE TABLE {MinMaxTimeUuidTable} (id uuid, timeuuid_sample timeuuid, PRIMARY KEY((id), timeuuid_sample))",
3939
string.Format(TestUtils.CreateTableAllTypes, AllTypesTableName)
4040
};
41+
42+
private static string GetToDateFunction()
43+
{
44+
if (TestClusterManager.CheckCassandraVersion(true, new Version(2, 2), Comparison.GreaterThanOrEqualsTo))
45+
{
46+
return "toDate";
47+
}
48+
else
49+
{
50+
return "dateOf";
51+
}
52+
}
4153

4254
public override void OneTimeSetUp()
4355
{
4456
base.OneTimeSetUp();
4557
var insertQuery = $"INSERT INTO {AllTypesTableName} (id, timeuuid_sample) VALUES (?, ?)";
46-
var selectQuery = $"SELECT id, timeuuid_sample, dateOf(timeuuid_sample) FROM {AllTypesTableName} WHERE id = ?";
58+
var selectQuery = $"SELECT id, timeuuid_sample, {GetToDateFunction()}(timeuuid_sample) FROM {AllTypesTableName} WHERE id = ?";
4759
if (TestClusterManager.CheckCassandraVersion(false, new Version(2, 2), Comparison.GreaterThanOrEqualsTo))
4860
{
4961
selectQuery =
@@ -114,7 +126,7 @@ public void RandomValuesTest()
114126
}
115127
Assert.DoesNotThrow(() => Task.WaitAll(tasks.ToArray()));
116128

117-
var selectQuery = $"SELECT id, timeuuid_sample, dateOf(timeuuid_sample) FROM {AllTypesTableName} LIMIT 10000";
129+
var selectQuery = $"SELECT id, timeuuid_sample, {GetToDateFunction()}(timeuuid_sample) FROM {AllTypesTableName} LIMIT 10000";
118130
Assert.DoesNotThrow(() =>
119131
Session.Execute(selectQuery).Select(r => r.GetValue<TimeUuid>("timeuuid_sample")).ToArray());
120132
}

src/Cassandra.IntegrationTests/Core/UdfTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ public void TestFixtureSetup()
5151
return;
5252
}
5353
_testCluster = TestClusterManager.GetTestCluster(1, 0, false, DefaultMaxClusterCreateRetries, false, false);
54-
_testCluster.UpdateConfig("enable_user_defined_functions: true");
54+
var cassandraYaml = "enable_user_defined_functions: true";
55+
if (TestClusterManager.CheckCassandraVersion(true, Version.Parse("5.0"), Comparison.GreaterThanOrEqualsTo))
56+
{
57+
cassandraYaml = "user_defined_functions_enabled: true";
58+
}
59+
_testCluster.UpdateConfig(cassandraYaml);
5560
_testCluster.Start(1);
5661
using (var cluster = ClusterBuilder().AddContactPoint(_testCluster.InitialContactPoint).Build())
5762
{

src/Cassandra.IntegrationTests/Policies/Tests/TokenAwareTransientReplicationTests.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,19 @@ namespace Cassandra.IntegrationTests.Policies.Tests
2828
[Category(TestCategory.Short), Category(TestCategory.ServerApi), Category(TestCategory.RealCluster)]
2929
public class TokenAwareTransientReplicationTests : SharedClusterTest
3030
{
31-
public TokenAwareTransientReplicationTests() : base(3, false, new TestClusterOptions
31+
public TokenAwareTransientReplicationTests() : base(() =>
3232
{
33-
UseVNodes = false,
34-
CassandraYaml = new[] { "enable_transient_replication: true" }
35-
})
33+
var cassandraYaml = "enable_transient_replication: true";
34+
if (TestClusterManager.CheckCassandraVersion(false, Version.Parse("5.0"), Comparison.GreaterThanOrEqualsTo))
35+
{
36+
cassandraYaml = "transient_replication_enabled: true";
37+
}
38+
return new TestClusterOptions
39+
{
40+
UseVNodes = false,
41+
CassandraYaml = new[] { cassandraYaml }
42+
};
43+
}, 3, false)
3644
{
3745
}
3846

src/Cassandra.IntegrationTests/SharedClusterTest.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ protected SharedClusterTest(
8282
Options = options;
8383
}
8484

85+
protected SharedClusterTest(
86+
Func<TestClusterOptions> options, int amountOfNodes = 1, bool createSession = true) : this(amountOfNodes, createSession, options?.Invoke())
87+
{
88+
}
89+
8590
protected virtual ITestCluster CreateNew(int nodeLength, TestClusterOptions options, bool startCluster)
8691
{
8792
return TestClusterManager.CreateNew(nodeLength, options, startCluster);

src/Cassandra.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ II.2.12 &lt;HandlesEvent /&gt;&#xD;
396396
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=4B80D0B37375A941B564E76B4E83EBB8/AbsolutePath/@EntryValue">D:\DataStax\csharp-driver\src\Cassandra.sln.DotSettings</s:String>
397397
<s:Boolean x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File4B80D0B37375A941B564E76B4E83EBB8/@KeyIndexDefined">True</s:Boolean>
398398
<s:Double x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File4B80D0B37375A941B564E76B4E83EBB8/RelativePriority/@EntryValue">1</s:Double>
399+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECodeCleanup_002EFileHeader_002EFileHeaderSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
399400
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpAttributeForSingleLineMethodUpgrade/@EntryIndexedValue">True</s:Boolean>
400401
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpFileLayoutPatternsUpgrade/@EntryIndexedValue">True</s:Boolean>
401402
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>

0 commit comments

Comments
 (0)