Skip to content

Commit 63c8f5f

Browse files
authored
[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
1 parent 19862f8 commit 63c8f5f

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

appveyor.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# for CI with appveyor.yml
2-
# Ref: https://www.yegor256.com/2015/01/10/windows-appveyor-maven.html
31
version: '{branch}-{build}'
42
image: Visual Studio 2017
53
hosts:
@@ -33,6 +31,8 @@ install:
3331
- cmd: dir/w
3432
- git clone https://github.com/wing328/swagger-samples
3533
- 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"
34+
- ps: $PSVersionTable.PSVersion
35+
- ps: Install-Module Pester -Force -Scope CurrentUser
3636
build_script:
3737
- dotnet --info
3838
# build C# API client (netcore)
@@ -67,7 +67,17 @@ test_script:
6767

6868
# generate all petstore clients (openapi3)
6969
- .\bin\openapi3\windows\run-all-petstore.cmd
70-
70+
# test ps pestore
71+
- ps: |
72+
$ErrorActionPreference = "Stop"
73+
cd samples\client\petstore\powershell-experimental\
74+
.\Build.ps1
75+
Import-Module -Name '.\src\PSPetstore'
76+
$Result = Invoke-Pester -PassThru
77+
if ($Result.FailedCount -gt 0) {
78+
$host.SetShouldExit($Result.FailedCount)
79+
exit $Result.FailedCount
80+
}
7181
cache:
7282
- C:\maven\
7383
- C:\gradle\

bin/utils/ensure-up-to-date

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ declare -a samples=(
8484
"${root}/bin/typescript-redux-query-petstore-with-npm-version.sh"
8585
"${root}/bin/cpp-restsdk-petstore.sh"
8686
"${root}/bin/cpp-qt5-qhttpengine-server-petstore.sh"
87+
"${root}/bin/openapi3/powershell-experimental-petstore.sh"
8788
)
8889

8990
# Some special case generators may expect to be run as a stanalone process (e.g. modifying classpath)

0 commit comments

Comments
 (0)