From 623c4811abe80ad2bb4d6467b0395d2c45968cf6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 26 Jan 2021 22:50:43 +0100 Subject: [PATCH] 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. --- appveyor.yml | 15 +++++++++++++++ build/tools/appveyor-test.bat | 9 --------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 29a18ef625..597caabdbf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 ---" diff --git a/build/tools/appveyor-test.bat b/build/tools/appveyor-test.bat index 5100ef9e9d..f0319c16ed 100755 --- a/build/tools/appveyor-test.bat +++ b/build/tools/appveyor-test.bat @@ -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.