-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Test all links in templates #8628
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 all commits
9627009
7767953
1cff6a0
8424edd
93e3904
bf6bd17
ad76c7f
3840127
a36cb35
fd26eaa
e14f810
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Threading.Tasks; | ||
using Templates.Test.Helpers; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Templates.Test | ||
{ | ||
public class GrpcTemplateTest | ||
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. @ryanbrandenburg we are going to be changing the template for gRPC pretty significantly since we'll be removing the client. We're going to need to update the test since our PRs will collide. |
||
{ | ||
public GrpcTemplateTest(ProjectFactoryFixture projectFactory, ITestOutputHelper output) | ||
{ | ||
ProjectFactory = projectFactory; | ||
Output = output; | ||
} | ||
|
||
public Project Project { get; set; } | ||
|
||
public ProjectFactoryFixture ProjectFactory { get; } | ||
public ITestOutputHelper Output { get; } | ||
|
||
[Fact(Skip = "https://github.com/aspnet/AspNetCore/issues/7973")] | ||
public async Task GrpcTemplate() | ||
{ | ||
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. Is this a class-library or an executable, if it's the former. Should we test it runs? /cc: @glennc 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. I didn't add that because I don't know what the expected behavior is. Would certainly be reasonable to at least check it doesn't crash instantly and file an issue for someone involved with Grpc to test expectations. |
||
Project = await ProjectFactory.GetOrCreateProject("grpc", Output); | ||
|
||
var createResult = await Project.RunDotNetNewAsync("grpc"); | ||
Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", Project, createResult)); | ||
|
||
var publishResult = await Project.RunDotNetPublishAsync(); | ||
Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", Project, publishResult)); | ||
|
||
var buildResult = await Project.RunDotNetBuildAsync(); | ||
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", Project, buildResult)); | ||
|
||
using (var serverProcess = Project.StartBuiltServerAsync()) | ||
{ | ||
Assert.False( | ||
serverProcess.Process.HasExited, | ||
ErrorMessages.GetFailedProcessMessageOrEmpty("Run built server", Project, serverProcess.Process)); | ||
|
||
using (var clientProcess = Project.StartBuiltClientAsync(serverProcess)) | ||
{ | ||
// Wait for the client to do its thing | ||
await Task.Delay(100); | ||
Assert.False( | ||
clientProcess.Process.HasExited, | ||
ErrorMessages.GetFailedProcessMessageOrEmpty("Run built client", Project, clientProcess.Process)); | ||
} | ||
} | ||
|
||
using (var aspNetProcess = Project.StartPublishedServerAsync()) | ||
{ | ||
Assert.False( | ||
aspNetProcess.Process.HasExited, | ||
ErrorMessages.GetFailedProcessMessageOrEmpty("Run published server", Project, aspNetProcess.Process)); | ||
|
||
using (var clientProcess = Project.StartPublishedClientAsync()) | ||
{ | ||
// Wait for the client to do its thing | ||
await Task.Delay(100); | ||
Assert.False( | ||
clientProcess.Process.HasExited, | ||
ErrorMessages.GetFailedProcessMessageOrEmpty("Run built client", Project, clientProcess.Process)); | ||
} | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Templates.Test.Helpers | ||
{ | ||
public static class PageUrls | ||
{ | ||
public const string HomeUrl = "/"; | ||
public const string PrivacyUrl = "/Privacy"; | ||
public const string PrivacyFullUrl = "/Home/Privacy"; | ||
public const string DocsUrl = "https://docs.microsoft.com/aspnet/core"; | ||
public const string LoginUrl = "/Identity/Account/Login"; | ||
public const string RegisterUrl = "/Identity/Account/Register"; | ||
public const string ForgotPassword = "/Identity/Account/ForgotPassword"; | ||
public const string ExternalArticle = "https://go.microsoft.com/fwlink/?LinkID=532715"; | ||
} | ||
} |
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.
👍