test(test-bin): Only write output file in CI and fix trailing whitespaces (#4613)

This commit is contained in:
Hsiao-nan Cheung
2021-12-31 02:14:53 +08:00
committed by GitHub
parent d5cb86078b
commit 5d8aeb54bb
4 changed files with 22 additions and 16 deletions
+8 -4
View File
@@ -6,14 +6,18 @@
- **depends:** Prevent error on no URL ([#4595](https://github.com/ScoopInstaller/Scoop/issues/4595))
- **decompress:** Fix nested Zstd archive extraction ([#4608](https://github.com/ScoopInstaller/Scoop/issues/4608))
### Documentation
- **changelog:** Add 'CHANGLOG.md' ([#4600](https://github.com/ScoopInstaller/Scoop/issues/4600))
### Styles
- **test:** Format scripts by VSCode's PowerShell extension ([#4609](https://github.com/ScoopInstaller/Scoop/issues/4609))
### Tests
- **test-bin:** Only write output file in CI and fix trailing whitespaces ([#4613](https://github.com/ScoopInstaller/Scoop/issues/4613))
### Documentation
- **changelog:** Add 'CHANGLOG.md' ([#4600](https://github.com/ScoopInstaller/Scoop/issues/4600))
<a name="2021-12-26"></a>
## [2021-12-26]
+3 -3
View File
@@ -2,7 +2,7 @@
# Summary: Returns the path to the specified app
param($app)
if(!$app) {
if (!$app) {
. "$psscriptroot\..\lib\help.ps1"
my_usage
exit 1
@@ -11,11 +11,11 @@ if(!$app) {
. "$psscriptroot\..\lib\core.ps1"
$app_path = versiondir $app 'current' $false
if(!(Test-Path $app_path)) {
if (!(Test-Path $app_path)) {
$app_path = versiondir $app 'current' $true
}
if(Test-Path $app_path) {
if (Test-Path $app_path) {
Write-Output $app_path
} else {
abort "Could not find app path for '$app'."
-3
View File
@@ -220,9 +220,6 @@
},
"persist": {
"$ref": "#/definitions/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
},
"license": {
"$ref": "#/definitions/license"
},
"license": {
"$ref": "#/definitions/license"
+11 -6
View File
@@ -6,17 +6,20 @@ param(
[String] $TestPath = 'test/'
)
$resultsXml = "$PSScriptRoot/TestResults.xml"
$excludes = @()
$splat = @{
Path = $TestPath
OutputFile = $resultsXml
OutputFormat = 'NUnitXML'
PassThru = $true
}
if ($env:CI -eq $true) {
$resultsXml = "$PSScriptRoot/TestResults.xml"
$excludes = @()
$splat += @{
OutputFile = $resultsXml
OutputFormat = 'NUnitXML'
}
$commit = if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT) { $env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT } else { $env:APPVEYOR_REPO_COMMIT }
$commitMessage = "$env:APPVEYOR_REPO_COMMIT_MESSAGE $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED".TrimEnd()
@@ -62,7 +65,9 @@ if ($env:CI -eq $true) {
Write-Host 'Invoke-Pester' @splat
$result = Invoke-Pester @splat
(New-Object Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", $resultsXml)
if ($env:CI -eq $true) {
(New-Object Net.WebClient).UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", $resultsXml)
}
if ($result.FailedCount -gt 0) {
exit $result.FailedCount