|
1 | 1 | // Licensed to the .NET Foundation under one or more agreements. |
2 | 2 | // The .NET Foundation licenses this file to you under the MIT license. |
3 | 3 |
|
4 | | -using System; |
5 | | -using System.Collections.Generic; |
6 | | -using System.IO; |
7 | | -using System.Linq; |
8 | | -using System.Threading.Tasks; |
9 | 4 | using Microsoft.AspNetCore.Testing; |
10 | 5 | using Templates.Test.Helpers; |
11 | | -using Xunit; |
12 | 6 | using Xunit.Abstractions; |
13 | | -using Xunit.Sdk; |
14 | 7 |
|
15 | 8 | namespace Templates.Test; |
16 | 9 |
|
@@ -83,18 +76,18 @@ private async Task MvcTemplateCore(string languageOverride) |
83 | 76 | var footerLinks = new string[] { PageUrls.PrivacyFullUrl }; |
84 | 77 |
|
85 | 78 | var pages = new List<Page> |
| 79 | + { |
| 80 | + new Page |
86 | 81 | { |
87 | | - new Page |
88 | | - { |
89 | | - Url = PageUrls.HomeUrl, |
90 | | - Links = menuLinks.Append(PageUrls.DocsUrl).Concat(footerLinks) |
91 | | - }, |
92 | | - new Page |
93 | | - { |
94 | | - Url = PageUrls.PrivacyFullUrl, |
95 | | - Links = menuLinks.Concat(footerLinks) |
96 | | - } |
97 | | - }; |
| 82 | + Url = PageUrls.HomeUrl, |
| 83 | + Links = menuLinks.Append(PageUrls.DocsUrl).Concat(footerLinks) |
| 84 | + }, |
| 85 | + new Page |
| 86 | + { |
| 87 | + Url = PageUrls.PrivacyFullUrl, |
| 88 | + Links = menuLinks.Concat(footerLinks) |
| 89 | + } |
| 90 | + }; |
98 | 91 |
|
99 | 92 | using (var aspNetProcess = project.StartBuiltProjectAsync()) |
100 | 93 | { |
@@ -234,68 +227,45 @@ public async Task MvcTemplate_IndividualAuth(bool useLocalDB) |
234 | 227 | } |
235 | 228 | } |
236 | 229 |
|
237 | | - [ConditionalFact(Skip = "https://github.com/dotnet/aspnetcore/issues/25103")] |
| 230 | + [ConditionalFact] |
| 231 | + [OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)] // Running these requires the rid-specific runtime pack to be available which is not consistent in all our platform builds. |
238 | 232 | [SkipOnHelix("cert failure", Queues = "All.OSX")] |
239 | 233 | public async Task MvcTemplate_SingleFileExe() |
240 | 234 | { |
241 | 235 | // This test verifies publishing an MVC app as a single file exe works. We'll limit testing |
242 | 236 | // this to a few operating systems to make our lives easier. |
243 | | - string runtimeIdentifer; |
244 | | - if (OperatingSystem.IsWindows()) |
245 | | - { |
246 | | - runtimeIdentifer = "win-x64"; |
247 | | - } |
248 | | - else if (OperatingSystem.IsLinux()) |
249 | | - { |
250 | | - runtimeIdentifer = "linux-x64"; |
251 | | - } |
252 | | - else |
253 | | - { |
254 | | - return; |
255 | | - } |
256 | | - |
| 237 | + var runtimeIdentifer = "win-x64"; |
257 | 238 | var project = await ProjectFactory.GetOrCreateProject("mvcsinglefileexe", Output); |
258 | 239 | project.RuntimeIdentifier = runtimeIdentifer; |
259 | 240 |
|
260 | | - var createResult = await project.RunDotNetNewAsync("mvc", auth: "Individual", useLocalDB: true); |
| 241 | + var createResult = await project.RunDotNetNewAsync("mvc"); |
261 | 242 | Assert.True(0 == createResult.ExitCode, ErrorMessages.GetFailedProcessMessage("create/restore", project, createResult)); |
262 | 243 |
|
263 | 244 | var publishResult = await project.RunDotNetPublishAsync(additionalArgs: $"/p:PublishSingleFile=true -r {runtimeIdentifer}", noRestore: false); |
264 | 245 | Assert.True(0 == publishResult.ExitCode, ErrorMessages.GetFailedProcessMessage("publish", project, publishResult)); |
265 | 246 |
|
266 | | - var pages = new[] |
| 247 | + var menuLinks = new[] |
267 | 248 | { |
268 | | - new Page |
269 | | - { |
270 | | - // Verify a view from the app works |
271 | | - Url = PageUrls.HomeUrl, |
272 | | - Links = new [] |
273 | | - { |
274 | | - PageUrls.HomeUrl, |
275 | | - PageUrls.RegisterUrl, |
276 | | - PageUrls.LoginUrl, |
277 | | - PageUrls.HomeUrl, |
278 | | - PageUrls.PrivacyUrl, |
279 | | - PageUrls.DocsUrl, |
280 | | - PageUrls.PrivacyUrl |
281 | | - } |
282 | | - }, |
283 | | - new Page |
284 | | - { |
285 | | - // Verify a view from a RCL (in this case IdentityUI) works |
286 | | - Url = PageUrls.RegisterUrl, |
287 | | - Links = new [] |
288 | | - { |
289 | | - PageUrls.HomeUrl, |
290 | | - PageUrls.RegisterUrl, |
291 | | - PageUrls.LoginUrl, |
292 | | - PageUrls.HomeUrl, |
293 | | - PageUrls.PrivacyUrl, |
294 | | - PageUrls.ExternalArticle, |
295 | | - PageUrls.PrivacyUrl |
296 | | - } |
297 | | - }, |
298 | | - }; |
| 249 | + PageUrls.HomeUrl, |
| 250 | + PageUrls.HomeUrl, |
| 251 | + PageUrls.PrivacyFullUrl |
| 252 | + }; |
| 253 | + |
| 254 | + var footerLinks = new[] { PageUrls.PrivacyFullUrl }; |
| 255 | + |
| 256 | + var pages = new List<Page> |
| 257 | + { |
| 258 | + new Page |
| 259 | + { |
| 260 | + Url = PageUrls.HomeUrl, |
| 261 | + Links = menuLinks.Append(PageUrls.DocsUrl).Concat(footerLinks), |
| 262 | + }, |
| 263 | + new Page |
| 264 | + { |
| 265 | + Url = PageUrls.PrivacyFullUrl, |
| 266 | + Links = menuLinks.Concat(footerLinks), |
| 267 | + } |
| 268 | + }; |
299 | 269 |
|
300 | 270 | using var aspNetProcess = project.StartPublishedProjectAsync(usePublishedAppHost: true); |
301 | 271 | Assert.False( |
|
0 commit comments