From 0fa99c3a6ba5384b71033cbe74ee6b8afcd0d983 Mon Sep 17 00:00:00 2001 From: Nora Huang Date: Tue, 1 Dec 2020 20:42:06 +0000 Subject: [PATCH] Merged PR 587278: Update nodejs version for rush test. Update nodejs version for rush test. Related work items: #1794623 --- .../RushIntegrationTestBase.cs | 9 +++++-- .../Rush/Test.BuildXL.FrontEnd.Rush.dsc | 25 +------------------ config.dsc | 13 ---------- 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/Public/Src/FrontEnd/UnitTests/Rush/IntegrationTests/RushIntegrationTestBase.cs b/Public/Src/FrontEnd/UnitTests/Rush/IntegrationTests/RushIntegrationTestBase.cs index 24d62e8f7..ac3bca8cf 100644 --- a/Public/Src/FrontEnd/UnitTests/Rush/IntegrationTests/RushIntegrationTestBase.cs +++ b/Public/Src/FrontEnd/UnitTests/Rush/IntegrationTests/RushIntegrationTestBase.cs @@ -273,9 +273,14 @@ config({{ string rushJson = File.ReadAllText(pathToRushJson); // Update the initial template created by 'rush init' to accept a higher version of node - var updatedRushJson = rushJson.Replace( + // Also update the pnpm version to make it work correctly with node + var updatedRushJson = rushJson + .Replace( "\"nodeSupportedVersionRange\": \">=10.13.0 <11.0.0\"", - "\"nodeSupportedVersionRange\": \">=10.13.0 <13.3.1\""); + "\"nodeSupportedVersionRange\": \">=10.13.0 <15.2.2\"") + .Replace( + "\"pnpmVersion\": \"2.15.1\"", + "\"pnpmVersion\": \"5.0.2\""); File.WriteAllText(pathToRushJson, updatedRushJson); } diff --git a/Public/Src/FrontEnd/UnitTests/Rush/Test.BuildXL.FrontEnd.Rush.dsc b/Public/Src/FrontEnd/UnitTests/Rush/Test.BuildXL.FrontEnd.Rush.dsc index d202fc6f0..ab6e12c53 100644 --- a/Public/Src/FrontEnd/UnitTests/Rush/Test.BuildXL.FrontEnd.Rush.dsc +++ b/Public/Src/FrontEnd/UnitTests/Rush/Test.BuildXL.FrontEnd.Rush.dsc @@ -86,31 +86,8 @@ namespace Test.Rush { }, { subfolder: a`node`, - contents: [getNodeExeForRushDirectory()] + contents: [Node.Node.nodeExecutables] }, ], }); - - const nodeWinDir = "node-v12.16.1-win-x64"; - const nodeOsxDir = "node-v12.16.1-darwin-x64"; - - function getNodeExeForRushDirectory(): StaticDirectory { - Contract.assert(isRunningOnSupportedSystem, "Only 64bit versions of Win and OSX supported."); - - let pkgContents : StaticDirectory = undefined; - - const host = Context.getCurrentHost(); - switch (host.os) { - case "win": - pkgContents = Transformer.reSealPartialDirectory(importFrom("NodeJs.ForRush.win-x64").extracted, r`${nodeWinDir}`); - break; - case "macOS": - pkgContents = Transformer.reSealPartialDirectory(importFrom("NodeJs.ForRush.osx-x64").extracted, r`${nodeOsxDir}\bin`); - break; - default: - Contract.fail(`The current NodeJs package doesn't support the current OS: ${host.os}. Ensure you run on a supported OS -or- update the NodeJs package to have the version embdded.`); - } - - return pkgContents; - } } diff --git a/config.dsc b/config.dsc index 512ecb606..788a0326d 100644 --- a/config.dsc +++ b/config.dsc @@ -495,19 +495,6 @@ config({ url: "https://nodejs.org/dist/v15.2.1/node-v15.2.1-linux-x64.tar.gz", hash: "VSO0:038EB56ECF4C3FEC397E149A91F32DDD0E91E9FB61E7BA064FB9E5E5C0A3779800", archiveType: "tgz", - }, - // Rush tests need an LTS (older) version of NodeJs - { - moduleName: "NodeJs.ForRush.win-x64", - url: "https://nodejs.org/dist/v12.16.1/node-v12.16.1-win-x64.zip", - hash: "VSO0:B65327703FB1775A7ABD637D44816CDE13DFE01BD98FF2B1B1DE8DAC46D1567800", - archiveType: "zip", - }, - { - moduleName: "NodeJs.ForRush.osx-x64", - url: "https://nodejs.org/dist/v12.16.1/node-v12.16.1-darwin-x64.tar.gz", - hash: "VSO0:A3DEEC9D7C133120F255195146072452C6D06D24E7F97754F342627C53A5008000", - archiveType: "tgz", } ], },