From 63640c288684bc538144875e6665fad6f0a45d20 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Thu, 11 Jul 2019 15:02:51 -0700 Subject: [PATCH] Improvements to building templates locally (#12022) Small improvements to building templates locally --- src/ProjectTemplates/README.md | 4 ++-- src/ProjectTemplates/build.cmd | 2 +- .../test/SpaTemplateTest/SpaTemplateTestBase.cs | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ProjectTemplates/README.md b/src/ProjectTemplates/README.md index fb78f4c331..bd9c0d7bf2 100644 --- a/src/ProjectTemplates/README.md +++ b/src/ProjectTemplates/README.md @@ -15,9 +15,9 @@ Some projects in this repository (like SignalR Java Client) require JDK installa 1. Run `git submodule update --init --recursive` if you haven't already. 1. Run `git submodule update` to update submodules. 1. Run `build.cmd -all -pack -configuration Release` in the repository root to build all of the dependencies. -1. Run `build.cmd -pack -NoRestore -NoBuilddeps` in this directory will produce NuGet packages for each class of template in the artifacts directory. +1. Run `build.cmd -pack -NoRestore -NoBuilddeps -configuration Release` in this directory will produce NuGet packages for each class of template in the artifacts directory. 1. Because the templates build against the version of `Microsoft.AspNetCore.App` that was built during the previous step, it is NOT advised that you install templates created on your local machine via `dotnet new -i [nupkgPath]`. Instead, use the `Run-[Template]-Locally.ps1` scripts in the script folder. These scripts do `dotnet new -i` with your packages, but also apply a series of fixes and tweaks to the created template which keep the fact that you don't have a production `Microsoft.AspNetCore.App` from interfering. 1. The ASP.NET localhost development certificate must also be installed and trusted or else you'll get a test error "Certificate error: Navigation blocked". -1. Run `build.cmd -test -NoRestore -NoBuild -NoBuilddeps "/p:RunTemplateTests=true"` to run template tests. +1. Run `.\build.cmd -test -NoRestore -NoBuild -NoBuilddeps -configuration Release "/p:RunTemplateTests=true"` to run template tests. ** Note** Templating tests require Visual Studio unless a full build (CI) is performed. diff --git a/src/ProjectTemplates/build.cmd b/src/ProjectTemplates/build.cmd index 35fb6cc3a3..b5aa28c663 100644 --- a/src/ProjectTemplates/build.cmd +++ b/src/ProjectTemplates/build.cmd @@ -1,3 +1,3 @@ @ECHO OFF SET RepoRoot=%~dp0..\.. -%RepoRoot%\build.cmd -projects %~dp0**\*.*proj "/p:EnforceE2ETestPrerequisites=true" %* +%RepoRoot%\build.cmd -projects %~dp0*\*.*proj "/p:EnforceE2ETestPrerequisites=true" %* diff --git a/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs b/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs index a32ecb54e8..cfa18a4f3e 100644 --- a/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs +++ b/src/ProjectTemplates/test/SpaTemplateTest/SpaTemplateTestBase.cs @@ -254,7 +254,8 @@ namespace Templates.Test.SpaTemplateTest badEntries = badEntries.Where(e => !e.Message.Contains("failed: WebSocket is closed before the connection is established.") - && !e.Message.Contains("[WDS] Disconnected!")); + && !e.Message.Contains("[WDS] Disconnected!") + && !e.Message.Contains("Timed out connecting to Chrome, retrying")); Assert.True(badEntries.Count() == 0, "There were Warnings or Errors from the browser." + Environment.NewLine + string.Join(Environment.NewLine, badEntries)); }