Verified Commit 39c872be authored by Pilou's avatar Pilou
Browse files

tests: don't install extraneous dependencies

- flake8 environment doesn't need dependencies listed in requirements.txt
- docs and flake8 environment doesn't require the enough application to
  be installed

Consequently, the tox execution time is reduced:

* flake8 environment
  * without this patch

        $ rm -rf .tox/flake8; time tox -e flake8
        flake8 create: /srv/share/src/ansible/enough.community/infrastructure.git/.tox/flake8
        flake8 installdeps: -r/srv/share/src/ansible/enough.community/infrastructure.git/requirements.txt, -r/srv/share/src/ansible/enough.community/infrastructure.git/requirements-dev.txt
        flake8 develop-inst: /srv/share/src/ansible/enough.community/infrastructure.git
        flake8 installed: alabaster==0.7.12,ansible==2.9.16,[...]
        [...]
          flake8: commands succeeded
          congratulations :)

        real    0m44.423s
        user    0m40.196s
        sys     0m3.549s

  * with this patch, 'develop-inst' step is skipped and requirements.txt isn't used

        $ rm -rf .tox/flake8; time tox -e flake8
        flake8 create: /srv/share/src/ansible/enough.community/infrastructure.git/.tox/flake8
        flake8 installdeps: -r/srv/share/src/ansible/enough.community/infrastructure.git/requirements-dev.txt
        flake8 installed: alabaster==0.7.12,appdirs==1.4.4,[...]
        [...]
          flake8: commands succeeded
          congratulations :)

        real    0m14.842s
        user    0m15.291s
        sys     0m0.834s

* docs environment
  * without this patch

        $ rm -rf .tox/docs; time tox -e docs
        docs create: /srv/share/src/ansible/enough.community/infrastructure.git/.tox/docs
        docs installdeps: -r/srv/share/src/ansible/enough.community/infrastructure.git/docs/requirements.txt
        docs develop-inst: /srv/share/src/ansible/enough.community/infrastructure.git
        docs installed: alabaster==0.7.12,ansible==2.9.16,[...]
        [...]
        Running Sphinx v1.8.2
        [...]
          docs: commands succeeded
          congratulations :)

        real    0m34.253s
        user    0m28.573s
        sys     0m2.942s

  * with this patch, 'develop-inst' step is skipped

        $ rm -rf .tox/docs; time tox -e docs
        docs create: /srv/share/src/ansible/enough.community/infrastructure.git/.tox/docs
        docs installdeps: -r/srv/share/src/ansible/enough.community/infrastructure.git/docs/requirements.txt
        docs installed: alabaster==0.7.12,Babel==2.9.0,[...]
        [...]
        Running Sphinx v1.8.2
        [...]
          docs: commands succeeded
          congratulations :)

        real    0m6.630s
        user    0m5.535s
        sys     0m0.496s
parent af3cb5ce
Pipeline #1831 passed with stage
in 31 minutes and 8 seconds
......@@ -20,6 +20,9 @@ commands = coverage run --source=enough {envbindir}/py.test -vvv --durations 10
[testenv:flake8]
commands = flake8 {posargs}
deps =
-r{toxinidir}/requirements-dev.txt
skip_install = True
#
# Integration tests
......@@ -44,6 +47,7 @@ passenv =
deps =
-r{toxinidir}/docs/requirements.txt
commands = sphinx-build -W -vvv -b html docs build/html
skip_install = True
[flake8]
exclude = venv,.tox,dist,doc,*.egg,build,docs/conf.py,src,playbooks/debops*,playbooks/wazuh/wazuh-ansible,playbooks/wazuh/roles
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment