Skip to content
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

CLIENT-3255: Setup TestCategory for SCMode and Enterprise tests #144

Merged
merged 3 commits into from
Jan 9, 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
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
Loading