Run httpbin in appveyor.yml to be able to stop it later

There is no way to stop a background task simply and safely with
cmd.exe, but in appveyor.yml we can use PowerShell, so use its job
support to do it instead.

This is important because AppVeyor waits until all jobs launched by the
script terminate, so without stopping the background job all builds
waited for an hour before timing out.
This commit is contained in:
Vadim Zeitlin
2021-01-26 22:50:43 +01:00
parent d5ebe48d93
commit 623c4811ab
2 changed files with 15 additions and 9 deletions

View File

@@ -71,4 +71,19 @@ before_build:
build_script: c:\projects\wxwidgets\build\tools\appveyor.bat
before_test:
- ps: |
Write-Output "Getting and launching httpbin."
pip install httpbin
Start-Job -Name wx_httpbin { python -m httpbin.core > c:\projects\wxwidgets\httpbin.log }
curl http://127.0.0.1:5000/ip
$env:WX_TEST_WEBREQUEST_URL="http://127.0.0.1:5000"
test_script: c:\projects\wxwidgets\build\tools\appveyor-test.bat
after_test:
- ps: |
Stop-Job -Name wx_httpbin
Write-Output "--- httpbin output ---"
Get-Content c:\projects\wxwidgets\httpbin.log
Write-Output "--- httpbin output end ---"

View File

@@ -1,12 +1,3 @@
echo.
echo --- Running httpbin...
echo.
pip install httpbin
start /b python -m httpbin.core
set WX_TEST_WEBREQUEST_URL=http://127.0.0.1:5000
curl http://127.0.0.1:5000/ip
echo.
echo --- Running tests.
echo.