[PowerShell] Test powershell petstore client in Appveyor (#5674)

* remove scala version in parent pom

* test ps petstore in appveyor

* fix command

* build and import

* fix import module

* fix import

* skip module import

* run multiple commands

* move to test script

* test ps exit

* fix exit

* check last status code

* clean tests

* exit last code

* add import

* change dir

* skip build failure

* fix check

* trigger build failure

* fail fast

* restore c# test

* new line comment

* add powershell exp to ensure up to date script
This commit is contained in:
William Cheng 2020-03-24 13:39:15 +08:00 committed by GitHub
parent 19862f85e3
commit 63c8f5f965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,3 @@
# for CI with appveyor.yml
# Ref: https://www.yegor256.com/2015/01/10/windows-appveyor-maven.html
version: '{branch}-{build}'
image: Visual Studio 2017
hosts:
@ -33,6 +31,8 @@ install:
- cmd: dir/w
- git clone https://github.com/wing328/swagger-samples
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
- ps: $PSVersionTable.PSVersion
- ps: Install-Module Pester -Force -Scope CurrentUser
build_script:
- dotnet --info
# build C# API client (netcore)
@ -67,7 +67,17 @@ test_script:
# generate all petstore clients (openapi3)
- .\bin\openapi3\windows\run-all-petstore.cmd
# test ps pestore
- ps: |
$ErrorActionPreference = "Stop"
cd samples\client\petstore\powershell-experimental\
.\Build.ps1
Import-Module -Name '.\src\PSPetstore'
$Result = Invoke-Pester -PassThru
if ($Result.FailedCount -gt 0) {
$host.SetShouldExit($Result.FailedCount)
exit $Result.FailedCount
}
cache:
- C:\maven\
- C:\gradle\

View File

@ -84,6 +84,7 @@ declare -a samples=(
"${root}/bin/typescript-redux-query-petstore-with-npm-version.sh"
"${root}/bin/cpp-restsdk-petstore.sh"
"${root}/bin/cpp-qt5-qhttpengine-server-petstore.sh"
"${root}/bin/openapi3/powershell-experimental-petstore.sh"
)
# Some special case generators may expect to be run as a stanalone process (e.g. modifying classpath)