Skip to content

Commit

Permalink
Delete trait
Browse files Browse the repository at this point in the history
  • Loading branch information
shacharPash committed Aug 10, 2023
1 parent d0f9573 commit 5496d02
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 37 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,14 @@ jobs:
echo "${{secrets.REDIS_USER_CRT}}" > tests/NRedisStack.Tests/bin/Debug/net6.0/redis_user.crt
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 Category!=edge
else
dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
fi
dotnet test -f net6.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Test
run: |
echo "${{secrets.REDIS_CA_PEM}}" > tests/NRedisStack.Tests/bin/Debug/net7.0/redis_ca.pem
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" ]; 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
dotnet test -f net7.0 --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Codecov
uses: codecov/codecov-action@v3
with:
Expand Down Expand Up @@ -105,4 +97,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 Category!=edge
dotnet test -f net481 --no-build --verbosity normal
2 changes: 0 additions & 2 deletions tests/NRedisStack.Tests/AbstractNRedisStackTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ namespace NRedisStack.Tests
{
public abstract class AbstractNRedisStackTest : IClassFixture<RedisFixture>, IAsyncLifetime
{
public Version ServerVersion => redisFixture.ServerVersion;

protected internal RedisFixture redisFixture;

protected internal AbstractNRedisStackTest(RedisFixture redisFixture) => this.redisFixture = redisFixture;
Expand Down
21 changes: 7 additions & 14 deletions tests/NRedisStack.Tests/Gears/GearsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public void Dispose()
}


[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public void TestTFunctionLoadDelete()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand All @@ -27,8 +26,7 @@ public void TestTFunctionLoadDelete()
}


[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public async Task TestTFunctionLoadDeleteAsync()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand All @@ -39,8 +37,7 @@ public async Task TestTFunctionLoadDeleteAsync()
Assert.True(await db.TFunctionDeleteAsync("lib"));
}

[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public void TestTFunctionList()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand Down Expand Up @@ -71,8 +68,7 @@ public void TestTFunctionList()
Assert.True(db.TFunctionDelete("lib3"));
}

[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public async Task TestTFunctionListAsync()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand Down Expand Up @@ -101,8 +97,7 @@ public async Task TestTFunctionListAsync()
Assert.True(await db.TFunctionDeleteAsync("lib3"));
}

[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public void TestTFCall()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand All @@ -116,8 +111,7 @@ public void TestTFCall()
Assert.True(db.TFunctionDelete("lib"));
}

[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public async Task TestTFCallAsync()
{
IDatabase db = redisFixture.Redis.GetDatabase();
Expand All @@ -131,8 +125,7 @@ public async Task TestTFCallAsync()
Assert.True(await db.TFunctionDeleteAsync("lib"));
}

[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public void TestGearsCommandBuilder()
{
// TFunctionLoad:
Expand Down
12 changes: 4 additions & 8 deletions tests/NRedisStack.Tests/Json/JsonTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,7 @@ public async Task GetAsync()
Assert.Equal(35, people[1]!.Age);
}

[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public void MSet()
{
IJsonCommands commands = new JsonCommands(redisFixture.Redis.GetDatabase());
Expand All @@ -728,8 +727,7 @@ public void MSet()
Assert.Throws<ArgumentOutOfRangeException>(() => commands.MSet(new KeyPathValue[0]));
}

[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public async Task MSetAsync()
{
IJsonCommandsAsync commands = new JsonCommands(redisFixture.Redis.GetDatabase());
Expand All @@ -752,8 +750,7 @@ await commands.MSetAsync(values)
await Assert.ThrowsAsync<ArgumentOutOfRangeException>(async () => await commands.MSetAsync(new KeyPathValue[0]));
}

[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public void Merge()
{
// Create a connection to Redis
Expand All @@ -772,8 +769,7 @@ public void Merge()
Assert.Equal("{\"person\":{\"name\":\"John Doe\",\"phone\":\"123-456-7890\",\"address\":{\"home\":\"123 Main Street\",\"work\":\"Redis office\"}}}", commands.Get("test_merge").ToString());
}

[Fact]
[Trait("Category", "edge")]
[SkipIfRedisVersionLt("7.1.242")]
public async Task MergeAsync()
{
// Create a connection to Redis
Expand Down
2 changes: 0 additions & 2 deletions tests/NRedisStack.Tests/RedisFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ public void Dispose()
}

public ConnectionMultiplexer Redis { get; private set; }

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

0 comments on commit 5496d02

Please sign in to comment.