未验证 提交 75574fa6 编写于 作者: C Cleber Rosa

Merge remote-tracking branch 'clebergnu/slim_test_requirements'

Signed-off-by: NCleber Rosa <crosa@redhat.com>
......@@ -287,3 +287,7 @@ Build and Quality Status
.. image:: https://img.shields.io/lgtm/grade/javascript/g/avocado-framework/avocado.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/avocado-framework/avocado/context:javascript
:alt: lgtm language grade for JavaScript
.. image:: https://readthedocs.org/projects/avocado-framework/badge/?version=latest
:target: https://avocado-framework.readthedocs.io
:alt: Documentation Status
......@@ -3,6 +3,10 @@
"description": "Test Plan to be performed before a release is cut",
"tests": [
{"name": "Check status of master branch",
"description": "Navigate to:\n\n https://github.com/avocado-framework/avocado#build-and-quality-status\n\nand make sure that all build and quality services report good indicators"},
{"name": "Avocado source is sound",
"description": "On your development machine, on a freshen Avocado source to be released, run `$ make check-full`. Expected result: Make command should say OK."},
......
......@@ -18,7 +18,7 @@ class GenDataTest(Test):
from PIL import Image
from PIL import ImageDraw
except ImportError:
return
self.cancel("PIL not available")
text = ["DREADED BLUE SCREEN OF DEATH"]
dmesg_path = os.path.join(self.job.logdir, "sysinfo", "pre", "dmesg_-c")
......
# Avocado test requirements
# sphinx (doc build test)
Sphinx==1.7.8
# inspektor (static and style checks)
pylint==2.3.0
......@@ -11,7 +9,6 @@ inspektor==0.5.2
funcsigs>=0.4
# To run make check
Pillow==5.2.0
aexpect==1.5.1
psutil==5.4.7
......
......@@ -78,7 +78,7 @@ def test_suite(base_selftests=True, plugin_selftests=None):
selftests_dir = os.path.dirname(os.path.abspath(__file__))
basedir = os.path.dirname(selftests_dir)
if base_selftests:
for section in ('unit', 'functional', 'doc'):
for section in ('unit', 'functional'):
start_dir = os.path.join(selftests_dir, section)
suite.addTests(loader.discover(start_dir=start_dir,
top_level_dir=basedir))
......
#!/bin/bash
PYTHON=${PYTHON:-python3}
ERR=()
RESULTS_DIR=$(./scripts/avocado config | grep datadir.paths.logs_dir | awk '{print $2}')
RESULTS_DIR=$($PYTHON -m avocado config | grep datadir.paths.logs_dir | awk '{print $2}')
# Very basic version of expanduser
RESULTS_DIR="${RESULTS_DIR/#\~/$HOME}"
......
"""
Build documentation and report whether we had warning/error messages.
This is geared towards documentation build regression testing.
"""
import os
import unittest
from avocado.utils import download
from avocado.utils import process
from .. import BASEDIR
class DocBuildError(Exception):
pass
def has_no_external_connectivity():
"""
Check condition for building the docs with Sphinx
Sphinx will attempt to fetch the Python objects inventory during the build
process. If for some reason, this test is being run on a machine that can
not access that address simply because of network restrictions (or the
developer may simply be on a plane) then it's better to SKIP the test than
to give a false positive.
"""
try:
download.url_open('http://docs.python.org/objects.inv')
return False
except Exception:
return True
class DocBuildTest(unittest.TestCase):
@unittest.skipIf(has_no_external_connectivity(), "No external connectivity")
def test_build_docs(self):
"""
Build avocado HTML docs, reporting failures
"""
ignore_list = []
failure_lines = []
# Disregard bogus warnings due to a bug in older versions of
# python-sphinx.
ignore_list.append(b'WARNING: toctree contains reference to '
b'nonexisting document u\'api/test/avocado.core\'')
ignore_list.append(b'WARNING: toctree contains reference to '
b'nonexisting document u\'api/test/avocado.plugins\'')
ignore_list.append(b'WARNING: toctree contains reference to '
b'nonexisting document u\'api/test/avocado.utils\'')
doc_dir = os.path.join(BASEDIR, 'docs')
process.run('make -C %s clean' % doc_dir)
result = process.run('make -C %s html' % doc_dir, ignore_status=True)
self.assertFalse(result.exit_status, "Doc build reported non-zero "
"status:\n%s" % result)
stdout = result.stdout.splitlines()
stderr = result.stderr.splitlines()
output_lines = stdout + stderr
for line in output_lines:
ignore_msg = False
for ignore in ignore_list:
if ignore in line:
print('Expected warning ignored: %s' % line.decode('utf-8'))
ignore_msg = True
if ignore_msg:
continue
if b'ERROR' in line:
failure_lines.append(line)
if b'WARNING' in line:
failure_lines.append(line)
if failure_lines:
e_msg = ('%s ERRORS and/or WARNINGS detected while building the html docs:\n' %
len(failure_lines))
for (index, failure_line) in enumerate(failure_lines):
e_msg += "%s) %s\n" % (index + 1, failure_line)
e_msg += ('Full output: %s\n'
% b'\n'.join(output_lines).decode('utf-8'))
e_msg += ('Please check the output and fix your '
'docstrings/.rst docs')
raise DocBuildError(e_msg)
if __name__ == '__main__':
unittest.main()
......@@ -25,9 +25,9 @@ with open(os.path.join(BASE_PATH, 'VERSION'), 'r') as version_file:
def get_long_description():
with open(os.path.join(BASE_PATH, 'README.rst'), 'r') as req:
req_contents = req.read()
return req_contents
with open(os.path.join(BASE_PATH, 'README.rst'), 'r') as readme:
readme_contents = readme.read()
return readme_contents
INSTALL_REQUIREMENTS = ['stevedore>=0.14', 'setuptools']
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册