# HG changeset patch # User Goffi # Date 1607081858 -3600 # Node ID b166a59b17247ebfeb1c3cb49cefddfada097671 # Parent 84fb41b515a1adc6872f0fb8c4c7a96472139ce5 tests, doc(testing): added `pytest-dependency` plugin to `backend_e2e` image + doc diff -r 84fb41b515a1 -r b166a59b1724 doc/contribuing/testing.rst --- a/doc/contribuing/testing.rst Fri Dec 04 12:36:06 2020 +0100 +++ b/doc/contribuing/testing.rst Fri Dec 04 12:37:38 2020 +0100 @@ -41,7 +41,6 @@ In addition to pytest option, some flags can be set with the following arguments: - ``--visual`` Launch a VNC viewer to see in real time browser based tests. You must have ``vncviewer`` executable available in your path (this is part of `TigerVNC`_) @@ -73,7 +72,25 @@ Then run a python console with given instructions +It's also good to know that in the e2e test environment, the following pytest plugins are +installed and used: + +`pytest-timeout`_ + To avoid having test stuck, it's good to terminate them after a while. A timeout of 60s + is set by default for each test (lower value can give false negatives, as some e2e tests + can be long, notably with Selenium). + +`pytest-dependency`_ + Even if good testing practice normally means that tests can be run independently, in the + case of e2e tests we are using a real environment, and some tests do create files, + PubSub nodes, accounts, etc. It would be resource consuming to delete then recreate them + only to have standalone tests, thus to keep tests short and simple, some of them must be + run in order. The *dependecy* plugin is used to manage that, and will skip tests if one + of their dependencies is failing. The markup help also to document the tests order. + .. _TigerVNC: https://tigervnc.org +.. _pytest-timeout: https://github.com/pytest-dev/pytest-timeout +.. _pytest-dependency: https://github.com/RKrahl/pytest-dependency common fixtures --------------- diff -r 84fb41b515a1 -r b166a59b1724 docker/backend_e2e/Dockerfile --- a/docker/backend_e2e/Dockerfile Fri Dec 04 12:36:06 2020 +0100 +++ b/docker/backend_e2e/Dockerfile Fri Dec 04 12:37:38 2020 +0100 @@ -44,7 +44,7 @@ RUN \ # pytest and its plugins - pip install pytest pytest-timeout \ + pip install pytest pytest-timeout pytest-dependency \ # needed to test jp sh \ # needed to test libervia