mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-05-03 16:21:38 +00:00
test(test-bin): Only write output file in CI and fix trailing whitespaces (#4613)
This commit is contained in:
+8
-4
@@ -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]
|
||||
|
||||
|
||||
@@ -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'."
|
||||
|
||||
@@ -220,9 +220,6 @@
|
||||
},
|
||||
"persist": {
|
||||
"$ref": "#/definitions/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
|
||||
},
|
||||
"license": {
|
||||
"$ref": "#/definitions/license"
|
||||
},
|
||||
"license": {
|
||||
"$ref": "#/definitions/license"
|
||||
|
||||
+11
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user