-
Notifications
You must be signed in to change notification settings - Fork 893
Accept dev localhost resource service URLs #17639
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
+77
−1
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,48 @@ await auto.WaitUntilAsync(s => | |
| await auto.WaitForSuccessPromptAsync(counter); | ||
| } | ||
|
|
||
| [CaptureWorkspaceOnFailure] | ||
| [Fact] | ||
| public async Task CreateAndRunPolyglotAppHostWithDevLocalhostUrls() | ||
| { | ||
| var repoRoot = CliE2ETestHelpers.GetRepoRoot(); | ||
| var strategy = CliInstallStrategy.Detect(output.WriteLine); | ||
|
|
||
| var workspace = TemporaryWorkspace.Create(output); | ||
|
|
||
| using var terminal = CliE2ETestHelpers.CreateDockerTestTerminal(repoRoot, strategy, output, mountDockerSocket: true, workspace: workspace); | ||
|
|
||
| var counter = new SequenceCounter(); | ||
| var auto = new Hex1bTerminalAutomator(terminal, defaultTimeout: TimeSpan.FromSeconds(500)); | ||
| await using var terminalRun = CliE2ETestHelpers.StartRun(terminal, workspace, auto, counter, output, TestContext.Current.CancellationToken); | ||
|
|
||
| await auto.PrepareDockerEnvironmentAsync(counter, workspace); | ||
| await auto.InstallAspireCliAsync(strategy, counter); | ||
|
|
||
| const string projectName = "PolyglotDevLocalhost"; | ||
| await auto.AspireNewAsync(projectName, counter, template: AspireTemplate.ExpressReact, useDevLocalhost: true); | ||
|
|
||
| await auto.RunCommandFailFastAsync($"cd {projectName}", counter); | ||
|
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. Need to rebase. This has been replaced with RunCommandAsync |
||
| await auto.RunCommandFailFastAsync("grep -F 'ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL' aspire.config.json && grep -F 'polyglotdevlocalhost.dev.localhost' aspire.config.json", counter); | ||
|
|
||
| await auto.TypeAsync("aspire run"); | ||
| await auto.EnterAsync(); | ||
|
|
||
| await auto.WaitUntilAsync(s => | ||
| { | ||
| if (s.ContainsText("Capability Error") || | ||
| s.ContainsText("ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL must contain a local loopback address")) | ||
| { | ||
| throw new InvalidOperationException("Polyglot AppHost failed to start with a *.dev.localhost resource service endpoint."); | ||
| } | ||
|
|
||
| return s.ContainsText("Press CTRL+C to stop the AppHost and exit."); | ||
| }, timeout: TimeSpan.FromMinutes(3), description: "Press CTRL+C message for polyglot AppHost with *.dev.localhost URLs"); | ||
|
|
||
| await auto.Ctrl().KeyAsync(Hex1bKey.C); | ||
| await auto.WaitForSuccessPromptAsync(counter); | ||
| } | ||
|
|
||
| [CaptureWorkspaceOnFailure] | ||
| [Fact] | ||
| public async Task LatestCliCanStartStableChannelAppHost() | ||
|
|
||
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
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.
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.
There are existing helper methods for testing whether a host is localhost or dev.localhost, etc on EndpointHostHelpers