Skip to content

Commit

Permalink
go back
Browse files Browse the repository at this point in the history
  • Loading branch information
shacharPash committed Aug 9, 2023
1 parent ce6d900 commit 826afe6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 47 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ jobs:
echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net6.0/redis_user_private.key
ls -R
if [ "$REDIS_VERSION" != "edge" ]; then
dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter RunOnlyOnThisVersion!=edge
elif [ "$REDIS_VERSION" == "7.2.0-RC3" ]; then
dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter SkipIfThisIsTheVersoin!=7.2.0-RC3
dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge
else
dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
fi
Expand All @@ -59,10 +57,8 @@ jobs:
echo "${{secrets.REDIS_USER_CRT}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_user.crt
echo "${{secrets.REDIS_USER_PRIVATE_KEY}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_user_private.key
ls -R
if [ "$REDIS_VERSION" != "edge" && "$REDIS_VERSION" != "7.2.0-RC3"]; then
dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter RunOnlyOnThisVersion!=edge
elif [ "$REDIS_VERSION" == "7.2.0-RC3" ]; then
dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter SkipIfThisIsTheVersoin!=7.2.0-RC3
if [ "$REDIS_VERSION" != "edge" ]; then
dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --filter Category!=edge
else
dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
fi
Expand Down Expand Up @@ -109,4 +105,4 @@ jobs:
shell: cmd
run: |
START wsl ./redis-stack-server-${{env.redis_stack_version}}/bin/redis-stack-server &
dotnet test -f net481 --no-build --verbosity normal --filter RunOnlyOnThisVersion!=edge
dotnet test -f net481 --no-build --verbosity normal --filter Category!=edge
14 changes: 7 additions & 7 deletions tests/NRedisStack.Tests/Gears/GearsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void Dispose()


[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public void TestTFunctionLoadDelete()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand All @@ -28,7 +28,7 @@ public void TestTFunctionLoadDelete()


[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public async Task TestTFunctionLoadDeleteAsync()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand All @@ -40,7 +40,7 @@ public async Task TestTFunctionLoadDeleteAsync()
}

[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public void TestTFunctionList()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand Down Expand Up @@ -72,7 +72,7 @@ public void TestTFunctionList()
}

[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public async Task TestTFunctionListAsync()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand Down Expand Up @@ -102,7 +102,7 @@ public async Task TestTFunctionListAsync()
}

[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public void TestTFCall()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand All @@ -117,7 +117,7 @@ public void TestTFCall()
}

[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public async Task TestTFCallAsync()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand All @@ -132,7 +132,7 @@ public async Task TestTFCallAsync()
}

[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public void TestGearsCommandBuilder()
{
// TFunctionLoad:
Expand Down
7 changes: 0 additions & 7 deletions tests/NRedisStack.Tests/Graph/GraphTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public void Dispose()
[SkipIfRedisVersionLt("7.2.0")]
public void TestReserveBasic()
{
Skip.IfServerLessThan(ServerVersion, "7.2.0");
IDatabase db = redisFixture.Redis.GetDatabase();
db.Execute("FLUSHALL");
var graph = db.GRAPH();
Expand All @@ -32,7 +31,6 @@ public void TestReserveBasic()
[SkipIfRedisVersionLt("7.2.0")]
public void TestCreateNode()
{
Skip.IfServerLessThan(ServerVersion, "7.2.0");
IDatabase db = redisFixture.Redis.GetDatabase();
db.Execute("FLUSHALL");
var graph = db.GRAPH();
Expand All @@ -56,7 +54,6 @@ public void TestCreateNode()
[SkipIfRedisVersionLt("7.2.0")]
public void TestCreateLabeledNode()
{
Skip.IfServerLessThan(ServerVersion, "7.2.0");
IDatabase db = redisFixture.Redis.GetDatabase();
db.Execute("FLUSHALL");
var graph = db.GRAPH();
Expand All @@ -78,7 +75,6 @@ public void TestCreateLabeledNode()
[SkipIfRedisVersionLt("7.2.0")]
public void TestConnectNodes()
{
Skip.IfServerLessThan(ServerVersion, "7.2.0");
IDatabase db = redisFixture.Redis.GetDatabase();
db.Execute("FLUSHALL");
var graph = db.GRAPH();
Expand Down Expand Up @@ -106,7 +102,6 @@ public void TestConnectNodes()
[SkipIfRedisVersionLt("7.2.0")]
public void TestDeleteNodes()
{
Skip.IfServerLessThan(ServerVersion, "7.2.0");
IDatabase db = redisFixture.Redis.GetDatabase();
db.Execute("FLUSHALL");
var graph = db.GRAPH();
Expand Down Expand Up @@ -184,7 +179,6 @@ public void TestDeleteRelationship()
[SkipIfRedisVersionLt("7.2.0")]
public void TestIndex()
{
Skip.IfServerLessThan(ServerVersion, "7.2.0");
IDatabase db = redisFixture.Redis.GetDatabase();
db.Execute("FLUSHALL");
var graph = db.GRAPH();
Expand Down Expand Up @@ -241,7 +235,6 @@ public void TestHeader()
}

[SkipIfRedisVersionLt("7.2.0")]
// [Trait("SkipIfThisIsTheVersoin", "7.2.0")]
public void TestRecord()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand Down
8 changes: 4 additions & 4 deletions tests/NRedisStack.Tests/Json/JsonTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ public async Task GetAsync()
}

[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public void MSet()
{
IJsonCommands commands = new JsonCommands(redisFixture.Redis.GetDatabase());
Expand All @@ -729,7 +729,7 @@ public void MSet()
}

[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public async Task MSetAsync()
{
IJsonCommandsAsync commands = new JsonCommands(redisFixture.Redis.GetDatabase());
Expand All @@ -753,7 +753,7 @@ await commands.MSetAsync(values)
}

[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public void Merge()
{
// Create a connection to Redis
Expand All @@ -773,7 +773,7 @@ public void Merge()
}

[Fact]
[Trait("RunOnlyOnThisVersion", "edge")]
[Trait("Category", "edge")]
public async Task MergeAsync()
{
// Create a connection to Redis
Expand Down
21 changes: 0 additions & 21 deletions tests/NRedisStack.Tests/RedisFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,5 @@ public void Dispose()
public ConnectionMultiplexer Redis { get; private set; }

public Version ServerVersion => Redis.GetServer(redis).Version;


public string? SkipIfServerLessThan(string minVersion)
{
if (ServerVersion < new Version(minVersion))
{
return $"Test skipped because Redis server version ({ServerVersion}) is less than {minVersion}.";
}

return null;
}

public string? SkipIfServerGreaterThan(string maxVersion)
{
if (ServerVersion > new Version(maxVersion))
{
return $"Test skipped because Redis server version ({ServerVersion}) is greater than {maxVersion}.";
}

return null;
}
}
}

0 comments on commit 826afe6

Please sign in to comment.