-
Notifications
You must be signed in to change notification settings - Fork 739
Split redis tests into separate test assembly #4468
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
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
50a9e63
Split redis tests into separate test assembly
davidfowl 8d36ff8
Made some fixes
davidfowl c6a1655
Added functional test
davidfowl fbda632
Use the resource name
davidfowl 3488419
Merge remote-tracking branch 'origin/main' into davidfowl/redis-tests
sebastienros 98d2f86
PR feedback
sebastienros 7e9eef0
Fix documentation
sebastienros c8be7b3
Mark functional test with RequiresDocker
sebastienros 6462358
Create AddDataVolume tests for Redis
sebastienros 1394ee8
Add BindMount tests
sebastienros 7268fe3
Add false positive check
sebastienros 6818dab
Merge remote-tracking branch 'origin/main' into davidfowl/redis-tests
sebastienros 03e54d3
Import TestServiceProvider
sebastienros 153f97b
Debugging functional tests
sebastienros 0859fb6
Apply PR feedback
sebastienros 497e633
Remove InternalVisibleTo
sebastienros c55aa34
Delete volumes after usage
sebastienros 9bc54e9
Fix erroneous samples
sebastienros 69f4ea9
Move AttemptDeleteDockerVolume to Utils class
sebastienros File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,13 +2,13 @@ | |
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Net.Sockets; | ||
| using Aspire.Hosting.Redis; | ||
| using Aspire.Hosting.ApplicationModel; | ||
| using Aspire.Hosting.Tests.Utils; | ||
| using Aspire.Hosting.Utils; | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using Xunit; | ||
|
|
||
| namespace Aspire.Hosting.Tests.Redis; | ||
| namespace Aspire.Hosting.Redis.Tests; | ||
|
|
||
| public class AddRedisTests | ||
| { | ||
|
|
@@ -125,7 +125,8 @@ public void WithRedisCommanderAddsRedisCommanderResource() | |
| public void WithRedisCommanderSupportsChangingContainerImageValues() | ||
| { | ||
| var builder = DistributedApplication.CreateBuilder(); | ||
| builder.AddRedis("myredis").WithRedisCommander(c => { | ||
| builder.AddRedis("myredis").WithRedisCommander(c => | ||
| { | ||
| c.WithImageRegistry("example.mycompany.com"); | ||
| c.WithImage("customrediscommander"); | ||
| c.WithImageTag("someothertag"); | ||
|
|
@@ -142,7 +143,8 @@ public void WithRedisCommanderSupportsChangingContainerImageValues() | |
| public void WithRedisCommanderSupportsChangingHostPort() | ||
| { | ||
| var builder = DistributedApplication.CreateBuilder(); | ||
| builder.AddRedis("myredis").WithRedisCommander(c => { | ||
| builder.AddRedis("myredis").WithRedisCommander(c => | ||
| { | ||
| c.WithHostPort(1000); | ||
| }); | ||
|
|
||
|
|
@@ -169,7 +171,10 @@ public async Task SingleRedisInstanceProducesCorrectRedisHostsVariable(string co | |
|
|
||
| var commander = builder.Resources.Single(r => r.Name.EndsWith("-commander")); | ||
|
|
||
| var config = await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(commander, DistributedApplicationOperation.Run, TestServiceProvider.Instance); | ||
| var config = await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line too long couldn't read the code. |
||
| commander, | ||
| DistributedApplicationOperation.Run, | ||
| TestServiceProvider.Instance); | ||
|
|
||
| Assert.Equal($"myredis1:{containerHost}:5001:0", config["REDIS_HOSTS"]); | ||
| } | ||
|
|
@@ -194,7 +199,10 @@ public async Task MultipleRedisInstanceProducesCorrectRedisHostsVariable(string | |
|
|
||
| var commander = builder.Resources.Single(r => r.Name.EndsWith("-commander")); | ||
|
|
||
| var config = await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync(commander, DistributedApplicationOperation.Run, TestServiceProvider.Instance); | ||
| var config = await EnvironmentVariableEvaluator.GetEnvironmentVariablesAsync( | ||
| commander, | ||
| DistributedApplicationOperation.Run, | ||
| TestServiceProvider.Instance); | ||
|
|
||
| Assert.Equal($"myredis1:{containerHost}:5001:0,myredis2:host2:5002:0", config["REDIS_HOSTS"]); | ||
| } | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.