Skip to content

Commit a5901c0

Browse files
Include Assets in helix builds (#23784)
* Include Assets in helix builds * Fix IdentityUI test
1 parent 66d6152 commit a5901c0

File tree

3 files changed

+11
-61
lines changed

3 files changed

+11
-61
lines changed

src/ProjectTemplates/test/ByteOrderMarkTest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
using System;
54
using System.Collections.Generic;
65
using System.IO;
76
using System.Linq;
87
using System.Text;
9-
using Microsoft.AspNetCore.Testing;
108
using Xunit;
119
using Xunit.Abstractions;
1210

src/ProjectTemplates/test/IdentityUIPackageTest.cs

Lines changed: 6 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -26,59 +26,6 @@ public IdentityUIPackageTest(ProjectFactoryFixture projectFactory, ITestOutputHe
2626

2727
public ITestOutputHelper Output { get; }
2828

29-
public static TheoryData<IDictionary<string, string>, string, string[]> MSBuildIdentityUIPackageOptions
30-
{
31-
get
32-
{
33-
var data = new TheoryData<IDictionary<string, string>, string, string[]>();
34-
35-
data.Add(new Dictionary<string, string>
36-
{
37-
["IdentityUIFrameworkVersion"] = "Bootstrap3"
38-
},
39-
"Bootstrap v3.4.1",
40-
Bootstrap3ContentFiles);
41-
42-
data.Add(new Dictionary<string, string>(), "Bootstrap v4.3.1", Bootstrap4ContentFiles);
43-
44-
return data;
45-
}
46-
}
47-
48-
public static string[] Bootstrap3ContentFiles { get; } = new string[]
49-
{
50-
"Identity/css/site.css",
51-
"Identity/js/site.js",
52-
"Identity/lib/bootstrap/dist/css/bootstrap-theme.css",
53-
"Identity/lib/bootstrap/dist/css/bootstrap-theme.css.map",
54-
"Identity/lib/bootstrap/dist/css/bootstrap-theme.min.css",
55-
"Identity/lib/bootstrap/dist/css/bootstrap-theme.min.css.map",
56-
"Identity/lib/bootstrap/dist/css/bootstrap.css",
57-
"Identity/lib/bootstrap/dist/css/bootstrap.css.map",
58-
"Identity/lib/bootstrap/dist/css/bootstrap.min.css",
59-
"Identity/lib/bootstrap/dist/css/bootstrap.min.css.map",
60-
"Identity/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot",
61-
"Identity/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.svg",
62-
"Identity/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf",
63-
"Identity/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff",
64-
"Identity/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2",
65-
"Identity/lib/bootstrap/dist/js/bootstrap.js",
66-
"Identity/lib/bootstrap/dist/js/bootstrap.min.js",
67-
"Identity/lib/bootstrap/dist/js/npm.js",
68-
"Identity/lib/jquery/LICENSE.txt",
69-
"Identity/lib/jquery/dist/jquery.js",
70-
"Identity/lib/jquery/dist/jquery.min.js",
71-
"Identity/lib/jquery/dist/jquery.min.map",
72-
"Identity/lib/jquery-validation/LICENSE.md",
73-
"Identity/lib/jquery-validation/dist/additional-methods.js",
74-
"Identity/lib/jquery-validation/dist/additional-methods.min.js",
75-
"Identity/lib/jquery-validation/dist/jquery.validate.js",
76-
"Identity/lib/jquery-validation/dist/jquery.validate.min.js",
77-
"Identity/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js",
78-
"Identity/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js",
79-
"Identity/lib/jquery-validation-unobtrusive/LICENSE.txt",
80-
};
81-
8229
public static string[] Bootstrap4ContentFiles { get; } = new string[]
8330
{
8431
"Identity/favicon.ico",
@@ -118,12 +65,12 @@ public static TheoryData<IDictionary<string, string>, string, string[]> MSBuildI
11865
"Identity/lib/jquery-validation-unobtrusive/LICENSE.txt",
11966
};
12067

121-
[ConditionalTheory]
122-
[MemberData(nameof(MSBuildIdentityUIPackageOptions))]
68+
[ConditionalFact]
12369
[SkipOnHelix("cert failure", Queues = "OSX.1014.Amd64;OSX.1014.Amd64.Open")]
12470
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/19716")]
125-
public async Task IdentityUIPackage_WorksWithDifferentOptions(IDictionary<string, string> packageOptions, string versionValidator, string[] expectedFiles)
71+
public async Task IdentityUIPackage_WorksWithDifferentOptions()
12672
{
73+
var packageOptions = new Dictionary<string, string>();
12774
Project = await ProjectFactory.GetOrCreateProject("identityuipackage" + string.Concat(packageOptions.Values), Output);
12875
var useLocalDB = false;
12976

@@ -147,6 +94,7 @@ public async Task IdentityUIPackage_WorksWithDifferentOptions(IDictionary<string
14794
Assert.True(0 == migrationsResult.ExitCode, ErrorMessages.GetFailedProcessMessage("run EF migrations", Project, migrationsResult));
14895
Project.AssertEmptyMigration("razorpages");
14996

97+
var versionValidator = "Bootstrap v4.3.1";
15098
using (var aspNetProcess = Project.StartBuiltProjectAsync())
15199
{
152100
Assert.False(
@@ -156,7 +104,7 @@ public async Task IdentityUIPackage_WorksWithDifferentOptions(IDictionary<string
156104
var response = await aspNetProcess.SendRequest("/Identity/lib/bootstrap/dist/css/bootstrap.css");
157105
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
158106
Assert.Contains(versionValidator, await response.Content.ReadAsStringAsync());
159-
await ValidatePublishedFiles(aspNetProcess, expectedFiles);
107+
await ValidatePublishedFiles(aspNetProcess, Bootstrap4ContentFiles);
160108
}
161109

162110
using (var aspNetProcess = Project.StartPublishedProjectAsync())
@@ -168,7 +116,7 @@ public async Task IdentityUIPackage_WorksWithDifferentOptions(IDictionary<string
168116
var response = await aspNetProcess.SendRequest("/Identity/lib/bootstrap/dist/css/bootstrap.css");
169117
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
170118
Assert.Contains(versionValidator, await response.Content.ReadAsStringAsync());
171-
await ValidatePublishedFiles(aspNetProcess, expectedFiles);
119+
await ValidatePublishedFiles(aspNetProcess, Bootstrap4ContentFiles);
172120
}
173121
}
174122

src/ProjectTemplates/test/ProjectTemplates.Tests.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<!-- Shared testing infrastructure for running E2E tests using selenium -->
44
<Import Project="$(SharedSourceRoot)E2ETesting\E2ETesting.props" />
@@ -39,6 +39,10 @@
3939
<Content Include="..\Web.Client.ItemTemplates\**" LinkBase="Assets\Web.Client.ItemTemplates" />
4040
</ItemGroup>
4141

42+
<ItemGroup>
43+
<HelixContent Include="$(OutputPath)$(TargetFramework)Assets\**" />
44+
</ItemGroup>
45+
4246
<ItemGroup>
4347
<ProjectReference Include="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj">
4448
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

0 commit comments

Comments
 (0)