Compare commits

..

3 Commits

Author SHA1 Message Date
aparnajyothi-y
04cc07025b Update Node.Tests.ps1 2024-07-08 17:01:08 +05:30
aparnajyothi-y
f6400f0d5f Update Node.Tests.ps1 2024-07-08 17:00:33 +05:30
gowridurgad
e996a46d44 Update Node.Tests.ps1 2024-06-28 16:28:06 +05:30
2 changed files with 13 additions and 13 deletions

View File

@@ -23,9 +23,9 @@ on:
jobs: jobs:
node: node:
name: Node name: Node
uses: actions/versions-package-tools/.github/workflows/build-tool-packages.yml@test-arm64 uses: actions/versions-package-tools/.github/workflows/build-tool-packages.yml@main
with: with:
tool-name: "node" tool-name: "node"
tool-version: ${{ inputs.VERSION || '18.12.0' }} tool-version: ${{ inputs.VERSION || '18.12.0' }}
publish-release: ${{ inputs.PUBLISH_RELEASES || false }} publish-release: ${{ inputs.PUBLISH_RELEASES || false }}
secrets: inherit secrets: inherit

View File

@@ -4,20 +4,20 @@ Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
Describe "Node.js" { Describe "Node.js" {
BeforeAll { BeforeAll {
function Get-UseNodeLogs { function Get-UseNodeLogs {
# GitHub Windows images don't have `HOME` variable # GitHub Windows images don't have `HOME` variable
$homeDir = $env:HOME ?? $env:HOMEDRIVE $homeDir = $env:HOME ?? $env:HOMEDRIVE
$logsFolderPath = Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages" -Resolve $logsFolderPath = Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages" -Resolve
$useNodeLogFile = Get-ChildItem -Path $logsFolderPath | Where-Object { $useNodeLogFile = Get-ChildItem -Path $logsFolderPath | Where-Object {
$logContent = Get-Content $_.Fullname -Raw $logContent = Get-Content $_.Fullname -Raw
return $logContent -match "setup-node@v" return $logContent -match "setup-node@v"
} | Select-Object -First 1 } | Select-Object -First 1
return $useNodeLogFile.Fullname return $useNodeLogFile.Fullname
}
} }
}
It "is available" { It "is available" {
"node --version" | Should -ReturnZeroExitCode "node --version" | Should -ReturnZeroExitCode
} }
@@ -37,7 +37,7 @@ BeforeAll {
$nodePath.startsWith($expectedPath) | Should -BeTrue -Because "'$nodePath' is not started with '$expectedPath'" $nodePath.startsWith($expectedPath) | Should -BeTrue -Because "'$nodePath' is not started with '$expectedPath'"
} }
It "cached version is used without downloading" { It "cached version is used without downloading" {
if ($env:RUNNER_TYPE -eq "self-hosted") { if ($env:RUNNER_TYPE -eq "self-hosted") {
# Get the installed version of Node.js # Get the installed version of Node.js
@@ -54,7 +54,7 @@ BeforeAll {
$useNodeLogContent | Should -Match "Found in cache" $useNodeLogContent | Should -Match "Found in cache"
} }
} }
It "Run simple code" { It "Run simple code" {
"node ./simple-test.js" | Should -ReturnZeroExitCode "node ./simple-test.js" | Should -ReturnZeroExitCode
} }