diff --git a/README.rst b/README.rst index 7fe1e4c89de8ed4f91afb5eeb95bc3b3070405d7..24060e1e03f1d3e3ff17ba356b443d93b46567d1 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/examples/testplans/release.json b/examples/testplans/release.json index 8c08f55c528d3daf965d0c15546f8c8b2cd65a1e..37f2dfa9b3198a10e3f6527ebff4df595da1fbe3 100644 --- a/examples/testplans/release.json +++ b/examples/testplans/release.json @@ -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."}, diff --git a/examples/tests/gendata.py b/examples/tests/gendata.py index f3318d2d02b586cb41071e1a85b3e411b41880e3..769bd344800a66b6901be8571c83400284b750e4 100755 --- a/examples/tests/gendata.py +++ b/examples/tests/gendata.py @@ -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") diff --git a/requirements-selftests.txt b/requirements-selftests.txt index f1e732eb68a0d1b21dae8173225b7e5c2d728c03..acfce5746d9c99bab16bb252391f6af8021a8f6d 100644 --- a/requirements-selftests.txt +++ b/requirements-selftests.txt @@ -1,6 +1,4 @@ # 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 diff --git a/selftests/__init__.py b/selftests/__init__.py index 82494d0ecf885f0f738c4a8825b4bec4b4eea605..4c2e2730c8c96d71ae9a769e3467682b918d2c8f 100644 --- a/selftests/__init__.py +++ b/selftests/__init__.py @@ -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)) diff --git a/selftests/checkall b/selftests/checkall index 311ecffe268f7e02de9d0007000b305d53a66cad..254d9084dff16102ccf73a7438074f8b9048605e 100755 --- a/selftests/checkall +++ b/selftests/checkall @@ -1,7 +1,7 @@ #!/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}" diff --git a/selftests/doc/__init__.py b/selftests/doc/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/selftests/doc/test_doc_build.py b/selftests/doc/test_doc_build.py deleted file mode 100644 index 271d9eab18af31692d68e94de4ecc8f07d24f60b..0000000000000000000000000000000000000000 --- a/selftests/doc/test_doc_build.py +++ /dev/null @@ -1,86 +0,0 @@ -""" -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() diff --git a/setup.py b/setup.py index 989b9c996fefff2a1efc19fdf3d5d876530da7b1..de53f5eace09e15a342cfa8b1219fe240354b924 100755 --- a/setup.py +++ b/setup.py @@ -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']