From f2629ce426b62d951f1e895ef4f20982b907e5ec Mon Sep 17 00:00:00 2001
From: Doug Bunting <6431421+dougbu@users.noreply.github.com>
Date: Thu, 18 Aug 2022 09:25:22 -0700
Subject: [PATCH] Backport parts of 48a81a70597f (#43357)

- was "Exclusively use Azure (public) feeds (#43303)"
- Correct ref to selenium-config.json
  - fix what broke `yarn install` in these directories
- Use `yarn` in aspnetcore-components-e2e pipeline
  - also correct a missing `--frozen-lockfile`

Co-authored-by: MerlinBot
---
 .azure/pipelines/components-e2e-tests.yml                    | 2 +-
 eng/targets/Npm.Common.targets                               | 5 ++++-
 .../test/Templates.Blazor.Tests/package.json                 | 2 +-
 src/ProjectTemplates/test/Templates.Tests/package.json       | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/.azure/pipelines/components-e2e-tests.yml b/.azure/pipelines/components-e2e-tests.yml
index ef9c8dcf87b..7badaca296c 100644
--- a/.azure/pipelines/components-e2e-tests.yml
+++ b/.azure/pipelines/components-e2e-tests.yml
@@ -40,7 +40,7 @@ jobs:
       displayName: Update submodules
     - script: ./restore.sh
       displayName: Run restore.sh
-    - script: npm install --prefix ./src/Components/test/E2ETest
+    - script: yarn install --frozen-lockfile --cwd ./src/Components/test/E2ETest
       displayName: NPM install
     - script: .dotnet/dotnet build ./src/Components/test/E2ETest -c $(BuildConfiguration) --no-restore
       displayName: Build
diff --git a/eng/targets/Npm.Common.targets b/eng/targets/Npm.Common.targets
index b236c04bace..97f7c9cf4dc 100644
--- a/eng/targets/Npm.Common.targets
+++ b/eng/targets/Npm.Common.targets
@@ -42,7 +42,10 @@
   <Target Name="Restore">
     <Telemetry EventName="NETCORE_ENGINEERING_TELEMETRY" EventData="Category=Restore" />
     <Message Importance="High" Text="Running yarn install on $(MSBuildProjectFullPath)" />
-    <Yarn Command="install --mutex network $(InstallArgs)" StandardOutputImportance="High" StandardErrorImportance="High" IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" />
+    <Yarn Command="install --mutex network $(InstallArgs) --frozen-lockfile"
+        StandardOutputImportance="High"
+        StandardErrorImportance="High"
+        IgnoreStandardErrorWarningFormat="$(IgnoreYarnWarnings)" />
   </Target>
 
   <Target Name="PrepareForBuild">
diff --git a/src/ProjectTemplates/test/Templates.Blazor.Tests/package.json b/src/ProjectTemplates/test/Templates.Blazor.Tests/package.json
index add79d4bdf8..cf27e575509 100644
--- a/src/ProjectTemplates/test/Templates.Blazor.Tests/package.json
+++ b/src/ProjectTemplates/test/Templates.Blazor.Tests/package.json
@@ -6,7 +6,7 @@
   "private": true,
   "scripts": {
     "selenium-standalone": "selenium-standalone",
-    "prepare": "selenium-standalone install --config ../../Shared/E2ETesting/selenium-config.json"
+    "prepare": "selenium-standalone install --config ../../../Shared/E2ETesting/selenium-config.json"
   },
   "author": "",
   "license": "MIT",
diff --git a/src/ProjectTemplates/test/Templates.Tests/package.json b/src/ProjectTemplates/test/Templates.Tests/package.json
index add79d4bdf8..cf27e575509 100644
--- a/src/ProjectTemplates/test/Templates.Tests/package.json
+++ b/src/ProjectTemplates/test/Templates.Tests/package.json
@@ -6,7 +6,7 @@
   "private": true,
   "scripts": {
     "selenium-standalone": "selenium-standalone",
-    "prepare": "selenium-standalone install --config ../../Shared/E2ETesting/selenium-config.json"
+    "prepare": "selenium-standalone install --config ../../../Shared/E2ETesting/selenium-config.json"
   },
   "author": "",
   "license": "MIT",
-- 
GitLab