Skip to content

Commit

Permalink
fix test result output on Windows (elastic#951)
Browse files Browse the repository at this point in the history
* fix test result output on Windows

Using `call` swallows the exit code of the test runner, making
Jenkins mark failed test runs as unstable instead of failed.

* exit if pytest fails

* set error code explicitly
  • Loading branch information
beniwohli committed Oct 27, 2020
1 parent 294e244 commit 0f2f40a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/run-tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ if "%VERSION%" == "2.7" set IGNORE_PYTHON3_WITH_PYTHON2=--ignore-glob="*\py3_*.p

set PYTEST_JUNIT="--junitxml=.\tests\python-agent-junit.xml"
if "%ASYNCIO%" == "true" (
call %PYTHON%\python.exe -m pytest %PYTEST_JUNIT% %IGNORE_PYTHON3_WITH_PYTHON2% --cov --cov-context=test --cov-branch --cov-config=setup.cfg -m "not integrationtest"
%PYTHON%\python.exe -m pytest %PYTEST_JUNIT% %IGNORE_PYTHON3_WITH_PYTHON2% --cov --cov-context=test --cov-branch --cov-config=setup.cfg -m "not integrationtest" || exit /b 1
)
if "%ASYNCIO%" == "false" (
call %PYTHON%\python.exe -m pytest %PYTEST_JUNIT% --ignore-glob="*\asyncio*\*" %IGNORE_PYTHON3_WITH_PYTHON2% --cov --cov-context=test --cov-branch --cov-config=setup.cfg -m "not integrationtest"
%PYTHON%\python.exe -m pytest %PYTEST_JUNIT% --ignore-glob="*\asyncio*\*" %IGNORE_PYTHON3_WITH_PYTHON2% --cov --cov-context=test --cov-branch --cov-config=setup.cfg -m "not integrationtest" || exit /b 1
)
call %PYTHON%\python.exe setup.py bdist_wheel

0 comments on commit 0f2f40a

Please sign in to comment.