From b5173c63ff41383af7f7cb6c26edd4c9d64c0459 Mon Sep 17 00:00:00 2001 From: Shannon Klaus Date: Wed, 8 Jan 2025 14:41:38 -0700 Subject: [PATCH 1/3] Use TestCategory to mark compression test as Enterprise and MRT tests as SCMode --- AerospikeTest/Async/TestAsyncTxn.cs | 2 +- AerospikeTest/Sync/Basic/TestPutGet.cs | 80 +++++++++++--------------- AerospikeTest/Sync/Basic/TestTxn.cs | 2 +- 3 files changed, 36 insertions(+), 48 deletions(-) diff --git a/AerospikeTest/Async/TestAsyncTxn.cs b/AerospikeTest/Async/TestAsyncTxn.cs index af397f37..5b175369 100644 --- a/AerospikeTest/Async/TestAsyncTxn.cs +++ b/AerospikeTest/Async/TestAsyncTxn.cs @@ -23,7 +23,7 @@ namespace Aerospike.Test { - [TestClass] + [TestClass, TestCategory("SCMode")] public class TestAsyncTxn : TestAsync { private static readonly string binName = "bin"; diff --git a/AerospikeTest/Sync/Basic/TestPutGet.cs b/AerospikeTest/Sync/Basic/TestPutGet.cs index a1d1e283..9e5344c5 100644 --- a/AerospikeTest/Sync/Basic/TestPutGet.cs +++ b/AerospikeTest/Sync/Basic/TestPutGet.cs @@ -104,56 +104,44 @@ public void PutGetGeoJson() Assert.AreEqual(r.GetValue("geo").GetType(), geoBin.value.GetType()); } - [TestMethod] + [TestMethod, TestCategory("Enterprise")] public void PutGetCompression() { - Node node = client.Nodes[0]; - IDictionary map = Info.Request(null, node); - Assert.IsNotNull(map); + WritePolicy writePolicy = new() + { + compress = true + }; + + Policy policy = new() + { + compress = true + }; + + Key key = new(args.ns, args.set, "putgetc"); + Record record; + + List list = new(); + int[] iterator = Enumerable.Range(0, 2000).ToArray(); + foreach (int i in iterator) + { + list.Add(i.ToString()); + } + + Bin bin1 = new("bin", list); + + client.Put(writePolicy, key, bin1); + record = client.Get(policy, key); + var bin1List = bin1.value.Object; + record.bins.TryGetValue("bin", out object recordBin); + CollectionAssert.AreEquivalent((List)bin1List, (List)recordBin); + + record = client.GetHeader(policy, key); + AssertRecordFound(key, record); - foreach (KeyValuePair entry in map) + // Generation should be greater than zero. Make sure it's populated. + if (record.generation == 0) { - string kvp = entry.Key; - - if (kvp.Equals("build_ee_sha")) // Compression only available in EE - { - Client.WritePolicy writePolicy = new() - { - compress = true - }; - - Policy policy = new() - { - compress = true - }; - - Key key = new(args.ns, args.set, "putgetc"); - Record record; - - List list = new(); - int[] iterator = Enumerable.Range(0, 2000).ToArray(); - foreach (int i in iterator) - { - list.Add(i.ToString()); - } - - Bin bin1 = new("bin", list); - - client.Put(writePolicy, key, bin1); - record = client.Get(policy, key); - var bin1List = bin1.value.Object; - record.bins.TryGetValue("bin", out object recordBin); - CollectionAssert.AreEquivalent((List)bin1List, (List)recordBin); - - record = client.GetHeader(policy, key); - AssertRecordFound(key, record); - - // Generation should be greater than zero. Make sure it's populated. - if (record.generation == 0) - { - Assert.Fail("Invalid record header: generation=" + record.generation + " expiration=" + record.expiration); - } - } + Assert.Fail("Invalid record header: generation=" + record.generation + " expiration=" + record.expiration); } } } diff --git a/AerospikeTest/Sync/Basic/TestTxn.cs b/AerospikeTest/Sync/Basic/TestTxn.cs index b5024183..2c56025d 100644 --- a/AerospikeTest/Sync/Basic/TestTxn.cs +++ b/AerospikeTest/Sync/Basic/TestTxn.cs @@ -21,7 +21,7 @@ namespace Aerospike.Test { - [TestClass] + [TestClass, TestCategory("SCMode")] public class TestTxn : TestSync { private static readonly string binName = "bin"; From 4c85646a53ec1434c5489b35bd8fbc677abcb1cb Mon Sep 17 00:00:00 2001 From: Shannon Klaus Date: Wed, 8 Jan 2025 14:43:32 -0700 Subject: [PATCH 2/3] Update year --- AerospikeTest/Async/TestAsyncTxn.cs | 2 +- AerospikeTest/Sync/Basic/TestPutGet.cs | 2 +- AerospikeTest/Sync/Basic/TestTxn.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AerospikeTest/Async/TestAsyncTxn.cs b/AerospikeTest/Async/TestAsyncTxn.cs index 5b175369..6d4fb21d 100644 --- a/AerospikeTest/Async/TestAsyncTxn.cs +++ b/AerospikeTest/Async/TestAsyncTxn.cs @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 Aerospike, Inc. + * Copyright 2012-2025 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. diff --git a/AerospikeTest/Sync/Basic/TestPutGet.cs b/AerospikeTest/Sync/Basic/TestPutGet.cs index 9e5344c5..391869fd 100644 --- a/AerospikeTest/Sync/Basic/TestPutGet.cs +++ b/AerospikeTest/Sync/Basic/TestPutGet.cs @@ -1,5 +1,5 @@ /* - * Copyright 2012-2024 Aerospike, Inc. + * Copyright 2012-2025 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. diff --git a/AerospikeTest/Sync/Basic/TestTxn.cs b/AerospikeTest/Sync/Basic/TestTxn.cs index 2c56025d..e02d3cb0 100644 --- a/AerospikeTest/Sync/Basic/TestTxn.cs +++ b/AerospikeTest/Sync/Basic/TestTxn.cs @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 Aerospike, Inc. + * Copyright 2012-2025 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. From 2ba583034cfdb64f0e95bfe1f0f64cbe80de7841 Mon Sep 17 00:00:00 2001 From: Shannon Klaus Date: Wed, 8 Jan 2025 15:08:16 -0700 Subject: [PATCH 3/3] Remove proxy client from codeql workflow --- .github/workflows/codeql-analysis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 19e7d8a9..2afdd0dd 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -75,10 +75,6 @@ jobs: cd AerospikeClient dotnet restore dotnet build -p:UseSharedCompilation=false --configuration Release - - cd ../AerospikeClientProxy - dotnet restore - dotnet build -p:UseSharedCompilation=false --configuration Release - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2