mirror of
https://code.forgejo.org/actions/go-versions
synced 2025-06-10 04:22:23 +02:00
Merge pull request #9 from nikita-bykov/migrate-go-versions
fixed tests
This commit is contained in:
commit
d1d87f9fce
1 changed files with 3 additions and 7 deletions
|
@ -2,6 +2,8 @@ Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
|
||||||
Import-Module (Join-Path $PSScriptRoot "../helpers/common-helpers.psm1")
|
Import-Module (Join-Path $PSScriptRoot "../helpers/common-helpers.psm1")
|
||||||
|
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
|
Set-Location -Path "source"
|
||||||
|
$sourceLocation = Get-Location
|
||||||
function Get-UseGoLogs {
|
function Get-UseGoLogs {
|
||||||
# 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
|
||||||
|
@ -15,7 +17,6 @@ BeforeAll {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[version]$Version = $env:VERSION
|
|
||||||
|
|
||||||
Describe "Go" {
|
Describe "Go" {
|
||||||
It "is available" {
|
It "is available" {
|
||||||
|
@ -23,6 +24,7 @@ Describe "Go" {
|
||||||
}
|
}
|
||||||
|
|
||||||
It "version is correct" {
|
It "version is correct" {
|
||||||
|
[version]$Version = $env:VERSION
|
||||||
$versionOutput = Invoke-Expression -Command "go version"
|
$versionOutput = Invoke-Expression -Command "go version"
|
||||||
$finalVersion = $Version.ToString(3)
|
$finalVersion = $Version.ToString(3)
|
||||||
If ($Version.Build -eq "0"){
|
If ($Version.Build -eq "0"){
|
||||||
|
@ -51,8 +53,6 @@ Describe "Go" {
|
||||||
|
|
||||||
|
|
||||||
It "Run simple code" {
|
It "Run simple code" {
|
||||||
Set-Location -Path "source"
|
|
||||||
$sourceLocation = Get-Location
|
|
||||||
$simpleLocation = Join-Path -Path $sourceLocation -ChildPath "simple"
|
$simpleLocation = Join-Path -Path $sourceLocation -ChildPath "simple"
|
||||||
Set-Location -Path $simpleLocation
|
Set-Location -Path $simpleLocation
|
||||||
"go run simple.go" | Should -ReturnZeroExitCode
|
"go run simple.go" | Should -ReturnZeroExitCode
|
||||||
|
@ -61,8 +61,6 @@ Describe "Go" {
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Run maps code" {
|
It "Run maps code" {
|
||||||
Set-Location -Path "source"
|
|
||||||
$sourceLocation = Get-Location
|
|
||||||
$mapsLocation = Join-Path -Path $sourceLocation -ChildPath "maps"
|
$mapsLocation = Join-Path -Path $sourceLocation -ChildPath "maps"
|
||||||
Set-Location -Path $mapsLocation
|
Set-Location -Path $mapsLocation
|
||||||
"go run maps.go" | Should -ReturnZeroExitCode
|
"go run maps.go" | Should -ReturnZeroExitCode
|
||||||
|
@ -71,8 +69,6 @@ Describe "Go" {
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Run methods code" {
|
It "Run methods code" {
|
||||||
Set-Location -Path "source"
|
|
||||||
$sourceLocation = Get-Location
|
|
||||||
$methodsLocation = Join-Path -Path $sourceLocation -ChildPath "methods"
|
$methodsLocation = Join-Path -Path $sourceLocation -ChildPath "methods"
|
||||||
Set-Location -Path $methodsLocation
|
Set-Location -Path $methodsLocation
|
||||||
"go run methods.go" | Should -ReturnZeroExitCode
|
"go run methods.go" | Should -ReturnZeroExitCode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue