[v2,0/7] test case blocking and logging

Message ID 20240206145716.71435-1-juraj.linkes@pantheon.tech (mailing list archive)
Headers
Series test case blocking and logging |

Message

Juraj LinkeŇ° Feb. 6, 2024, 2:57 p.m. UTC
  We currently don't record test case results that couldn't be executed
because of a previous failure, such as when a test suite setup failed,
resulting in no executed test cases.

In order to record the test cases that couldn't be executed, we must
know the lists of test suites and test cases ahead of the actual test
suite execution, as an error could occur before we even start executing
test suites.

In addition, the patch series contains two refactors and one
improvement.

The first refactor is closely related. The dts.py was renamed to
runner.py and given a clear purpose - running the test suites and all
other orchestration needed to run test suites. The logic for this was
not all in the original dts.py module and it was brought there. The
runner is also responsible for recording results, which is the blocked
test cases are recorded.

The other refactor, logging, is related to the first refactor. The
logging module was simplified while extending capabilities. Each test
suite logs into its own log file in addition to the main log file which
the runner must handle (as it knows when we start executing particular
test suites). The runner also handles the switching between execution
stages for the purposes of logging.

The one aforementioned improvement is in unifying how we specify test
cases in the conf.yaml file and in the environment variable/command line
argument.

v2:
Rebase and update of the whole patch. There are changes in all parts of
the code, mainly improving the design and logic.
Also added the last patch which improves test suite specification on the
cmdline.

Juraj LinkeŇ° (7):
  dts: convert dts.py methods to class
  dts: move test suite execution logic to DTSRunner
  dts: filter test suites in executions
  dts: reorganize test result
  dts: block all test cases when earlier setup fails
  dts: refactor logging configuration
  dts: improve test suite and case filtering

 doc/guides/tools/dts.rst                      |  14 +-
 dts/framework/config/__init__.py              |  36 +-
 dts/framework/config/conf_yaml_schema.json    |   2 +-
 dts/framework/dts.py                          | 338 ---------
 dts/framework/logger.py                       | 235 +++---
 dts/framework/remote_session/__init__.py      |   6 +-
 .../interactive_remote_session.py             |   6 +-
 .../remote_session/interactive_shell.py       |   6 +-
 .../remote_session/remote_session.py          |   8 +-
 dts/framework/runner.py                       | 701 ++++++++++++++++++
 dts/framework/settings.py                     | 188 +++--
 dts/framework/test_result.py                  | 565 ++++++++------
 dts/framework/test_suite.py                   | 239 +-----
 dts/framework/testbed_model/node.py           |  11 +-
 dts/framework/testbed_model/os_session.py     |   7 +-
 .../traffic_generator/traffic_generator.py    |   6 +-
 dts/main.py                                   |   9 +-
 dts/pyproject.toml                            |   3 +
 dts/tests/TestSuite_smoke_tests.py            |   2 +-
 19 files changed, 1354 insertions(+), 1028 deletions(-)
 delete mode 100644 dts/framework/dts.py
 create mode 100644 dts/framework/runner.py