Skip to content

Commit

Permalink
CLIENT-3255: Setup TestCategory for SCMode and Enterprise tests (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonklaus authored Jan 9, 2025
1 parent a008a41 commit 28396c2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 55 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions AerospikeTest/Async/TestAsyncTxn.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -23,7 +23,7 @@

namespace Aerospike.Test
{
[TestClass]
[TestClass, TestCategory("SCMode")]
public class TestAsyncTxn : TestAsync
{
private static readonly string binName = "bin";
Expand Down
82 changes: 35 additions & 47 deletions AerospikeTest/Sync/Basic/TestPutGet.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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<string, string> 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<string> 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<string>)bin1List, (List<object>)recordBin);

record = client.GetHeader(policy, key);
AssertRecordFound(key, record);

foreach (KeyValuePair<string, string> 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<string> 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<string>)bin1List, (List<object>)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);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions AerospikeTest/Sync/Basic/TestTxn.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -21,7 +21,7 @@

namespace Aerospike.Test
{
[TestClass]
[TestClass, TestCategory("SCMode")]
public class TestTxn : TestSync
{
private static readonly string binName = "bin";
Expand Down

0 comments on commit 28396c2

Please sign in to comment.