-
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
Changes from 15 commits
50a9e63
8d36ff8
c6a1655
fbda632
3488419
98d2f86
7e9eef0
c8be7b3
6462358
1394ee8
7268fe3
6818dab
03e54d3
153f97b
0859fb6
497e633
c55aa34
9bc54e9
69f4ea9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
|
|
||
| <ItemGroup> | ||
| <InternalsVisibleTo Include="Aspire.Hosting.Tests" /> | ||
| <InternalsVisibleTo Include="Aspire.Hosting.Redis.Tests" /> | ||
|
||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| 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"]); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should aim to remove this.