Skip to content

Commit

Permalink
[Helix] Enable Identity.FunctionalTests (dotnet#8564)
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoK authored Mar 26, 2019
1 parent d9bf013 commit 1f63f25
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup>

<ItemGroup>
Expand All @@ -26,4 +24,29 @@
<Reference Include="AngleSharp" />
</ItemGroup>

<Target Name="PublishAssets" AfterTargets="Publish">
<ItemGroup>
<_PublishFiles Include="$(MSBuildThisFileDirectory)..\..\UI\src\bin\$(Configuration)\netcoreapp3.0\Microsoft.AspNetCore.Identity.UI.Views.*.dll" />
<_PublishFiles Include="$(MSBuildThisFileDirectory)..\..\testassets\Identity.DefaultUI.WebSite\bin\$(Configuration)\netcoreapp3.0\Identity.DefaultUI.WebSite.deps.json" />
<_PublishFiles Include="$(MSBuildThisFileDirectory)..\..\testassets\Identity.DefaultUI.WebSite\bin\$(Configuration)\netcoreapp3.0\Identity.DefaultUI.WebSite.deps.json" />
<_wwwrootFiles Include="$(MSBuildThisFileDirectory)..\..\testassets\Identity.DefaultUI.WebSite\wwwroot\**\*.*" />
<_PagesFiles Include="$(MSBuildThisFileDirectory)..\..\testassets\Identity.DefaultUI.WebSite\Pages\**\*.*" />
</ItemGroup>
<Copy
SourceFiles="@(_PublishFiles)"
DestinationFolder="$(PublishDir)" />
<Copy
SourceFiles="@(_PagesFiles)"
DestinationFolder="$(PublishDir)\Identity.DefaultUI.WebSite\Pages" />
<Copy
SourceFiles="@(_wwwrootFiles)"
DestinationFolder="$(PublishDir)\Identity.DefaultUI.WebSite\wwwroot" />
<!-- Drop a dummy sln to specify content root location -->
<WriteLinesToFile
File="$(PublishDir)\contentroot.sln"
Lines="Ignored"
Overwrite="true"
Encoding="Unicode"/>
</Target>

</Project>
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.

using System;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Http;

namespace Identity.DefaultUI.WebSite
{
/// <summary>
/// Provides version hash for a specified file.
/// </summary>
internal class FileVersionProvider : IFileVersionProvider
{
public string AddFileVersionToPath(PathString requestPathBase, string path) => path;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o">
</script>
</environment>
<script src="~/js/site.js" asp-append-version="true"></script>
<script src="~/js/site.js"></script>

@RenderSection("Scripts", required: false)
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.Configuration;
Expand Down Expand Up @@ -51,11 +52,16 @@ public virtual void ConfigureServices(IServiceCollection services)

services.AddMvc()
.AddNewtonsoftJson();

services.AddSingleton<IFileVersionProvider, FileVersionProvider>();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// This prevents running out of file watchers on some linux machines
((PhysicalFileProvider)env.WebRootFileProvider).UseActivePolling = false;

if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
Expand Down

0 comments on commit 1f63f25

Please sign in to comment.