-
Notifications
You must be signed in to change notification settings - Fork 733
[tests] Add more playground apps #5395
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 all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a9e392e
[tests] Add WithDockerfile playground app test
radical 0bdbfeb
[tests] Add Kakfa playground app to tests
radical 736b871
WithDockerfile playground app: Set DOCKER_BUILDKIT=1
radical 5e9602e
WatchNotifications: Cancel, or set exception on tcs when WatchAsync f…
radical a7cb8ce
LoggerNotificationExtensions: Add WaitForAllTestAsync
radical 7162617
Use the new method from LoggerNotificationExtensions
radical f861204
fix build
radical c1ce916
Fix test
radical 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 |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using Aspire.Hosting; | ||
| using Aspire.Hosting.Tests.Utils; | ||
| using SamplesIntegrationTests; | ||
| using SamplesIntegrationTests.Infrastructure; | ||
| using Xunit; | ||
| using Xunit.Abstractions; | ||
|
|
||
| namespace Aspire.Playground.Tests; | ||
|
|
||
| public class ProjectSpecificTests(ITestOutputHelper _testOutput) | ||
| { | ||
| [Fact] | ||
| public async Task WithDockerfileTest() | ||
| { | ||
| var appHostPath = Directory.GetFiles(AppContext.BaseDirectory, "WithDockerfile.AppHost.dll").Single(); | ||
| var appHost = await DistributedApplicationTestFactory.CreateAsync(appHostPath, _testOutput); | ||
| await using var app = await appHost.BuildAsync(); | ||
|
|
||
| await app.StartAsync(); | ||
| await app.WaitForResources().WaitAsync(TimeSpan.FromMinutes(2)); | ||
|
|
||
| await app.WaitForTextAsync($"I'm Batman. - Batman") | ||
| .WaitAsync(TimeSpan.FromMinutes(3)); | ||
|
|
||
| app.EnsureNoErrorsLogged(); | ||
| await app.StopAsync(); | ||
| } | ||
|
|
||
| [Fact] | ||
| public async Task KafkaTest() | ||
| { | ||
| var appHostPath = Directory.GetFiles(AppContext.BaseDirectory, "KafkaBasic.AppHost.dll").Single(); | ||
| var appHost = await DistributedApplicationTestFactory.CreateAsync(appHostPath, _testOutput); | ||
| await using var app = await appHost.BuildAsync(); | ||
|
|
||
| await app.StartAsync(); | ||
| await app.WaitForResources().WaitAsync(TimeSpan.FromMinutes(2)); | ||
|
|
||
| await WaitForAllTextAsync(app, | ||
| [ | ||
| "Hello, World! 343", | ||
| "Received 1000 messages." | ||
| ], | ||
| timeoutSecs: 120); | ||
|
|
||
| app.EnsureNoErrorsLogged(); | ||
| await app.StopAsync(); | ||
| } | ||
|
|
||
| internal static Task WaitForAllTextAsync(DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, int timeoutSecs = -1) | ||
| { | ||
| CancellationTokenSource cts = new(); | ||
| if (timeoutSecs > 0) | ||
| { | ||
| cts.CancelAfter(TimeSpan.FromSeconds(timeoutSecs)); | ||
| } | ||
|
|
||
| return app.WaitForAllTextAsync(logTexts, resourceName, cts.Token); | ||
| } | ||
| } |
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
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.
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.
Do you need this here or in the MSBuild file.
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.
I set it here to have it close to where it is needed.
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.
Why do we have it in both places?
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.
It is set for tests running on the build machine (note to self: can be dropped now), and for
basictestson helix.