Skip to content

Commit

Permalink
Added missing tests, removed some fact skips
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Sep 26, 2024
1 parent 56c853a commit 65d357e
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 35 deletions.
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '2'

services:
redis:
image: grokzen/redis-cluster:7.0.10
Expand All @@ -11,6 +9,11 @@ services:
- 7000-7005:7000-7005 # cluster
- 7006-7007:7006-7007 # single
- 5000-5002:5000-5002 # sentinel
deploy:
resources:
limits:
memory: 2g

ready:
image: andrewlock/wait-for-dependencies
command: redis:7000
Expand Down
6 changes: 6 additions & 0 deletions tests/Foundatio.Redis.Tests/Jobs/RedisJobQueueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ public override Task CanRunQueueJobAsync()
{
return base.CanRunQueueJobAsync();
}

[Fact]
public override Task ActivityWillFlowThroughQueueJobAsync()
{
return base.ActivityWillFlowThroughQueueJobAsync();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using Foundatio.AsyncEx;
Expand Down
82 changes: 50 additions & 32 deletions tests/Foundatio.Redis.Tests/Queues/RedisQueueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected override IQueue<SimpleWorkItem> GetQueue(int retries = 1, TimeSpan? wo
.LoggerFactory(Log)
);

_logger.LogDebug("Queue Id: {queueId}", queue.QueueId);
_logger.LogDebug("Queue Id: {QueueId}", queue.QueueId);
return queue;
}

Expand All @@ -58,6 +58,24 @@ public override Task CanQueueAndDequeueWorkItemAsync()
return base.CanQueueAndDequeueWorkItemAsync();
}

[Fact]
public override Task CanQueueAndDequeueWorkItemWithDelayAsync()
{
return base.CanQueueAndDequeueWorkItemWithDelayAsync();
}

[Fact]
public override Task CanUseQueueOptionsAsync()
{
return base.CanUseQueueOptionsAsync();
}

[Fact]
public override Task CanDiscardDuplicateQueueEntriesAsync()
{
return base.CanDiscardDuplicateQueueEntriesAsync();
}

[Fact]
public override Task CanDequeueWithCancelledTokenAsync()
{
Expand Down Expand Up @@ -106,12 +124,6 @@ public override Task CanUseQueueWorkerAsync()
return base.CanUseQueueWorkerAsync();
}

[Fact]
public override Task CanRenewLockAsync()
{
return base.CanRenewLockAsync();
}

[Fact]
public override Task CanHandleErrorInWorkerAsync()
{
Expand All @@ -136,7 +148,7 @@ public override Task CanAutoCompleteWorkerAsync()
return base.CanAutoCompleteWorkerAsync();
}

[RetryFact]
[Fact]
public override Task CanHaveMultipleQueueInstancesAsync()
{
return base.CanHaveMultipleQueueInstancesAsync();
Expand All @@ -155,27 +167,21 @@ public override Task CanRunWorkItemWithMetricsAsync()
}

[Fact]
public override Task CanAbandonQueueEntryOnceAsync()
public override Task CanRenewLockAsync()
{
return base.CanAbandonQueueEntryOnceAsync();
return base.CanRenewLockAsync();
}

[Fact]
public override Task CanCompleteQueueEntryOnceAsync()
public override Task CanAbandonQueueEntryOnceAsync()
{
return base.CanCompleteQueueEntryOnceAsync();
return base.CanAbandonQueueEntryOnceAsync();
}

[Fact]
public override Task CanHandleAutoAbandonInWorker()
{
return base.CanHandleAutoAbandonInWorker();
}

[Fact(Skip = "Need to fix some sort of left over metrics from other tests issue")]
public override Task CanUseQueueOptionsAsync()
public override Task CanCompleteQueueEntryOnceAsync()
{
return base.CanUseQueueOptionsAsync();
return base.CanCompleteQueueEntryOnceAsync();
}

[RetryFact]
Expand All @@ -198,6 +204,30 @@ public override async Task CanHaveMultipleQueueInstancesWithLockingAsync()
await CanHaveMultipleQueueInstancesWithLockingImplAsync(distributedLock);
}

[Fact]
public override Task MaintainJobNotAbandon_NotWorkTimeOutEntry()
{
return base.MaintainJobNotAbandon_NotWorkTimeOutEntry();
}

[Fact]
public override Task VerifyRetryAttemptsAsync()
{
return base.VerifyRetryAttemptsAsync();
}

[Fact]
public override Task VerifyDelayedRetryAttemptsAsync()
{
return base.VerifyDelayedRetryAttemptsAsync();
}

[Fact]
public override Task CanHandleAutoAbandonInWorker()
{
return base.CanHandleAutoAbandonInWorker();
}

[Fact]
public async Task VerifyCacheKeysAreCorrect()
{
Expand Down Expand Up @@ -687,18 +717,6 @@ await queue.StartWorkingAsync(async workItem =>
_logger.LogTrace("# Keys: {0}", muxer.CountAllKeysAsync());
}

[Fact]
public override Task VerifyRetryAttemptsAsync()
{
return base.VerifyRetryAttemptsAsync();
}

[Fact]
public override Task VerifyDelayedRetryAttemptsAsync()
{
return base.VerifyDelayedRetryAttemptsAsync();
}

[Fact]
public async Task CanHaveDifferentMessageTypeInQueueWithSameNameAsync()
{
Expand Down
18 changes: 18 additions & 0 deletions tests/Foundatio.Redis.Tests/Storage/RedisFileStorageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public override Task CanGetFileListForSingleFolderAsync()
return base.CanGetFileListForSingleFolderAsync();
}

[Fact]
public override Task CanGetFileListForSingleFileAsync()
{
return base.CanGetFileListForSingleFileAsync();
}

[Fact]
public override Task CanGetPagedFileListForSingleFolderAsync()
{
Expand Down Expand Up @@ -127,4 +133,16 @@ public override Task WillRespectStreamOffsetAsync()
{
return base.WillRespectStreamOffsetAsync();
}

[Fact(Skip = "Write Stream is not yet supported")]
public override Task WillWriteStreamContentAsync()
{
return base.WillWriteStreamContentAsync();
}

[Fact]
public override Task CanSaveOverExistingStoredContent()

Check failure on line 144 in tests/Foundatio.Redis.Tests/Storage/RedisFileStorageTests.cs

View workflow job for this annotation

GitHub Actions / build / build

'RedisFileStorageTests.CanSaveOverExistingStoredContent()': no suitable method found to override

Check failure on line 144 in tests/Foundatio.Redis.Tests/Storage/RedisFileStorageTests.cs

View workflow job for this annotation

GitHub Actions / build / build

'RedisFileStorageTests.CanSaveOverExistingStoredContent()': no suitable method found to override
{
return base.CanSaveOverExistingStoredContent();
}
}

0 comments on commit 65d357e

Please sign in to comment.