Skip to content

slapos-sr-testing: Add instance parameters to filter what is tested

Introduce parameters to choose which SRs are tested and what arguments are passed to python -m unittest:

  • only-sr: a list of software releases names to test
  • unittest-args: a list of arguments for unittest

The default behavior (when neither only-sr nor unittest-args is given) is the same as before:

  • all the SRs are tested
  • the test command is python -m unittest discover -v, which runs all the tests in all the modules of the form test*.py

But now we can do things like:

{
  "only-sr": "theia",
  "unittest-args": "test.TestTheia.test_http_get"
}

which will only launch python -m unittest test.TestTheia.test_http_get in the theia SR.

Such parameters can be specified via the Slapos Parameters field of a test suite.

Several SRs can be specified using a list of strings instead of a single string, and the same for several arguments.

For example: "unittest-args": ["-v", "test.TestTheia.test_http_get"]

This is a spin-off from Theia Resiliency MR https://lab.nexedi.com/nexedi/slapos/merge_requests/931, where it was introduced to provide a convenient way to launch ERP5-in-Theia resiliency tests separately from other tests. See this comment for more details.

Edited by Xavier Thompson

Merge request reports