[ADD] dump logs

This commit is contained in:
Benedek Racz 2020-02-01 21:34:34 +01:00
parent ee0b06f289
commit 557f759ff6
3 changed files with 23 additions and 3 deletions

View File

@ -18,11 +18,15 @@ install:
test_script:
- tox
on_failure:
- python dump_logs.py
after_test:
# Upload code coverage results.
# https://github.com/codecov/codecov-python/issues/158#issuecomment-514282362
- codecov --no-color -X gcov --file coverage.xml --required || (sleep 5 && codecov --no-color -X gcov --file coverage.xml --required) || (sleep 5 && codecov --no-color -X gcov --file coverage.xml --required) || (sleep 5 && codecov --no-color -X gcov --file coverage.xml --required) || (sleep 5 && codecov --no-color -X gcov --file coverage.xml --required)
- codecov --required || (sleep 5 && codecov --required) || (sleep 5 && codecov --required) || (sleep 5 && codecov --required) || (sleep 5 && codecov --required)
# fill .pypirc file.
# pypi
- cmd: "echo [pypi] > %USERPROFILE%\\.pypirc"
@ -52,4 +56,4 @@ after_test:
- IF %APPVEYOR_REPO_BRANCH%==test (
twine upload -r testpypi dist\\wexpect*.tar.gz
)

15
dump_logs.py Normal file
View File

@ -0,0 +1,15 @@
import os
import glob
read_files = glob.glob(".wlog/*.log")
for f in read_files:
with open(f, "r") as infile:
print(infile.read())
read_files = glob.glob("tests/.wlog/*.log")
for f in read_files:
with open(f, "rb") as infile:
print(infile.read())

View File

@ -6,10 +6,11 @@ envlist = py{37}-spawn_pipe
[testenv]
description = Unit tests
setenv =
WEXPECT_LOGGER_LEVEL = DEBUG
spawn_pipe: WEXPECT_SPAWN_CLASS=SpawnPipe
legacy_wexpect: WEXPECT_SPAWN_CLASS=legacy_wexpect
commands =
pip install .[test]
coverage run -m unittest tests.test_echo.EchoTestCase.testPath tests.test_expect.ExpectTestCase.test_before_after tests.test_long.TestCaseLong.test_long
coverage run -m unittest tests.test_echo.EchoTestCase.testPath tests.test_expect.ExpectTestCase.test_before_after
coverage report --omit tests/*
coverage xml --omit tests/*