mirror of
https://github.com/certbot/certbot.git
synced 2026-01-26 07:41:33 +03:00
Reduce build log verbosity on Travis (#6597)
PR #6568 removed the --quiet option in pip invocations, because this option deletes a lot of extremely useful logs when something goes wrong. However, when everything goes right, or at least when pip install is correctly executed, theses logs add hundreds of lines that are only noise, making hard to debug errors that can be in only one or two lines. We can have best of both worlds. Travis allows to fold large blocks of logs, that can be expanded directly from the UI if needed. It only requires to print in the console some specific code, that this PR implements in the pip_install.py script when the build is run in Travis (known by the existence of TRAVIS environment variable). I also take the occasion to clean up a little tox.ini. Note that AppVeyor does not have this fold capability, but it can be emulated using a proper capture of stdout/stderr delivered only when an error is detected. * Fold pip install log on travis * Global test env * Export env variable
This commit is contained in:
committed by
Brad Warren
parent
5130e9ba1e
commit
b52cbc0fb7
@@ -9,6 +9,7 @@ before_install:
|
||||
|
||||
before_script:
|
||||
- 'if [ $TRAVIS_OS_NAME = osx ] ; then ulimit -n 1024 ; fi'
|
||||
- export TOX_TESTENV_PASSENV=TRAVIS
|
||||
|
||||
matrix:
|
||||
include:
|
||||
|
||||
@@ -24,6 +24,7 @@ install:
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- set TOX_TESTENV_PASSENV=APPVEYOR
|
||||
# Test env is set by TOXENV env variable
|
||||
- tox
|
||||
|
||||
|
||||
@@ -71,6 +71,11 @@ def main(args):
|
||||
tools_path = find_tools_path()
|
||||
working_dir = tempfile.mkdtemp()
|
||||
|
||||
if os.environ.get('TRAVIS'):
|
||||
# When this script is executed on Travis, the following print will make the log
|
||||
# be folded until the end command is printed (see finally section).
|
||||
print('travis_fold:start:install_certbot_deps')
|
||||
|
||||
try:
|
||||
test_constraints = os.path.join(working_dir, 'test_constraints.txt')
|
||||
all_constraints = os.path.join(working_dir, 'all_constraints.txt')
|
||||
@@ -89,6 +94,8 @@ def main(args):
|
||||
call_with_print('"{0}" -m pip install --constraint "{1}" {2}'
|
||||
.format(sys.executable, all_constraints, ' '.join(args)))
|
||||
finally:
|
||||
if os.environ.get('TRAVIS'):
|
||||
print('travis_fold:end:install_certbot_deps')
|
||||
shutil.rmtree(working_dir)
|
||||
|
||||
|
||||
|
||||
7
tox.ini
7
tox.ini
@@ -64,9 +64,6 @@ source_paths =
|
||||
tests/lock_test.py
|
||||
|
||||
[testenv]
|
||||
passenv =
|
||||
TRAVIS
|
||||
APPVEYOR
|
||||
commands =
|
||||
{[base]install_and_test} {[base]all_packages}
|
||||
python tests/lock_test.py
|
||||
@@ -176,7 +173,6 @@ whitelist_externals =
|
||||
docker
|
||||
passenv =
|
||||
DOCKER_*
|
||||
TRAVIS
|
||||
|
||||
[testenv:nginx_compat]
|
||||
commands =
|
||||
@@ -187,7 +183,6 @@ whitelist_externals =
|
||||
docker
|
||||
passenv =
|
||||
DOCKER_*
|
||||
TRAVIS
|
||||
|
||||
[testenv:le_auto_precise]
|
||||
# At the moment, this tests under Python 2.7 only, as only that version is
|
||||
@@ -199,7 +194,6 @@ whitelist_externals =
|
||||
docker
|
||||
passenv =
|
||||
DOCKER_*
|
||||
TRAVIS
|
||||
|
||||
[testenv:le_auto_trusty]
|
||||
# At the moment, this tests under Python 2.7 only, as only that version is
|
||||
@@ -212,7 +206,6 @@ whitelist_externals =
|
||||
docker
|
||||
passenv =
|
||||
DOCKER_*
|
||||
TRAVIS
|
||||
TRAVIS_BRANCH
|
||||
|
||||
[testenv:le_auto_wheezy]
|
||||
|
||||
Reference in New Issue
Block a user