diff --git a/.vsts-ci/misc-analysis.yml b/.vsts-ci/misc-analysis.yml index f8504fd730f..d9e7aa46e98 100644 --- a/.vsts-ci/misc-analysis.yml +++ b/.vsts-ci/misc-analysis.yml @@ -44,10 +44,7 @@ jobs: condition: succeededOrFailed() - bash: | - # Installing globally with yarn is a pain, please don't try - sudo npm install -g markdown-spellcheck@0.11.0 - # Sometimes this folder is left behind with root permissions and is needed by later npm installs which don't need sudo - sudo rm -rf ~/.npm/_cacache + sudo yarn global add markdown-spellcheck@0.11.0 displayName: Install mdspell condition: succeededOrFailed() diff --git a/test/common/markdown/cleanup.ps1 b/test/common/markdown/cleanup.ps1 deleted file mode 100644 index 90aa1d38016..00000000000 --- a/test/common/markdown/cleanup.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -Start-Process ` --FilePath "npm" ` --ArgumentList @('install','rimraf','-g','--silent') ` --Wait ` --WorkingDirectory $PSScriptRoot ` --NoNewWindow -Start-Process ` --FilePath "rimraf" ` --ArgumentList @(Join-Path -Path $PSScriptRoot -ChildPath 'node_modules') ` --Wait ` --WorkingDirectory $PSScriptRoot ` --NoNewWindow diff --git a/test/common/markdown/markdown-link.tests.ps1 b/test/common/markdown/markdown-link.tests.ps1 index 542327a8856..3526810eac1 100644 --- a/test/common/markdown/markdown-link.tests.ps1 +++ b/test/common/markdown/markdown-link.tests.ps1 @@ -8,9 +8,7 @@ Describe "Verify Markdown Links" { { Write-Verbose "installing markdown-link-check ..." -Verbose start-nativeExecution { - sudo npm install -g markdown-link-check@3.7.2 - # Sometimes this folder is left behind with root permissions and is needed by later NPM installs which don't need sudo - sudo rm -rf ~/.npm/_cacache + sudo yarn global add markdown-link-check@3.7.2 } } @@ -49,7 +47,7 @@ Describe "Verify Markdown Links" { $jobs.add($group.name,$job) } - Write-Verbose -verbose "Getting and printing results ..." + Write-Verbose -verbose "Getting results ..." # Get the results and verify foreach($key in $jobs.keys) { @@ -105,7 +103,8 @@ Describe "Verify Markdown Links" { if($url -match '^http(s)?:') { # If invoke-WebRequest can handle the URL, re-verify, with 5 retries - try{ + try + { $null = Invoke-WebRequest -uri $url -RetryIntervalSec 3 -MaximumRetryCount 6 } catch diff --git a/test/common/markdown/markdown.tests.ps1 b/test/common/markdown/markdown.tests.ps1 index f81329b6a2f..05f759d7017 100644 --- a/test/common/markdown/markdown.tests.ps1 +++ b/test/common/markdown/markdown.tests.ps1 @@ -22,10 +22,7 @@ Describe 'Common Tests - Validate Markdown Files' -Tag 'CI' { if(!(Get-Command -Name 'gulp' -ErrorAction SilentlyContinue)) { start-nativeExecution { - # Installing globally with yarn is a pain, please don't try it - sudo npm install -g 'gulp@4.0.0' --silent - # Sometimes this folder is left behind with root permissions and is needed by later NPM installs which don't need sudo - sudo rm -rf ~/.npm/_cacache + sudo yarn global add 'gulp@4.0.0' } } if(!(Get-Command -Name 'node' -ErrorAction SilentlyContinue)) diff --git a/test/common/markdown/package.json b/test/common/markdown/package.json index a55f2c778b3..bc50ef1040b 100644 --- a/test/common/markdown/package.json +++ b/test/common/markdown/package.json @@ -1,7 +1,8 @@ { "name": "powershell.common.markdown.tests", + "private": true, "version": "1.0.0", - "description": "The PowerShell Common MarkDown Tests.", + "description": "The PowerShell Common Markdown Tests.", "main": "gulpfile.js", "dependencies": { "gulp": "^4.0.2",