Skip to content

Commit 9423a52

Browse files
NaddiNadjasafl
authored andcommitted
fix(docs/testrunner): remove double definition of testrunner args
These can be found in the in-code documentation. Signed-off-by: Nadja Brix Koch <[email protected]>
1 parent 175bfa8 commit 9423a52

File tree

2 files changed

+23
-44
lines changed

2 files changed

+23
-44
lines changed

docs/source/testrunner/index.rst

+13-40
Original file line numberDiff line numberDiff line change
@@ -55,43 +55,16 @@ In a :ref:`workflow <sec-resources-workflows>` the :ref:`core.testrunner
5555
random_order: false
5656
run_local: false
5757
58-
Here you see three "special" arguments to the testrunner:
59-
60-
args
61-
These arguments are passed verbatim to **pytest**, resulting in the following
62-
invocation:
63-
64-
.. code-block:: bash
65-
66-
pytest \
67-
--config cijoe-config.toml \
68-
--output output \
69-
-k "filtering" my_tests
70-
71-
The key difference between invoking the ``pytest`` command-line tool directly
72-
and using the **cijoe** script :ref:`core.testrunner <sec-packages-core-testrunner>`
73-
in the **cijoe** workflow is that the latter integrates the **pytest** report into
74-
**cijoe**, producing a cohesive and standalone report.
75-
76-
random_order
77-
This option **scrambles** the order in which tests are executed. It is
78-
generally recommended, as it helps reduce inter-test dependencies and
79-
assumptions about the environment's state.
80-
81-
run_local
82-
This option can take some time to understand fully. It controls where
83-
**pytest** is executed.
84-
85-
- When ``run_local: false``, the behavior is "normal" — the
86-
**pytest** command-line tool is executed on the **initiator**, and
87-
the :ref:`configuration-file <sec-resources-configs>` provided to the
88-
**cijoe** command-line tool is passed verbatim to **pytest**.
89-
90-
- When ``run_local: true``, this behavior changes. The **pytest**
91-
command-line tool is executed on the **target** instead. Before execution,
92-
the provided :ref:`configuration-file <sec-resources-configs>` is cloned,
93-
modified by removing the transport section, and then transferred to the
94-
**target**. Once transferred, **pytest** is executed on the **target** using
95-
the modified configuration file. Finally, the **pytest** report generated on
96-
the **target** is transferred back to the **initiator** for integration into
97-
the **cijoe** report.
58+
This will result in the following invocation on the initiator:
59+
60+
.. code-block:: bash
61+
62+
pytest \
63+
--config cijoe-config.toml \
64+
--output output \
65+
-k "filtering" my_tests
66+
67+
The key difference between invoking the ``pytest`` command-line tool directly
68+
and using the **cijoe** script :ref:`core.testrunner <sec-packages-core-testrunner>`
69+
in the **cijoe** workflow is that the latter integrates the **pytest** report into
70+
**cijoe**, producing a cohesive and standalone report.

src/cijoe/core/scripts/testrunner.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def test_foo(cijoe):
3333
by ``args.run_local``, with boolean value True / False. The default is
3434
True.
3535
36-
* args.run_local: True
36+
* ``args.run_local: True``
3737
3838
This is the most common, invoking pytest locally, which in turn will be using
3939
the same config as all other cijoe-scripts. To clarify, cijoe will execute
4040
'pytest' in the same environment/system where the ``cijoe`` cli was executed.
4141
42-
* args.run_local: False
42+
* ``args.run_local: False``
4343
4444
This is a special-case, where a collection of pytests uses cijoe, but only the
4545
configuration, the that the pytest verify is Python code / statements /
@@ -81,9 +81,15 @@ def __call__(self, parser, namespace, values, option_string=None):
8181
choices=["true", "false"],
8282
default=True,
8383
action=StringToBoolAction,
84-
help="Whether the tests should be run in random order",
84+
help=(
85+
"Whether the tests should be run in random order. "
86+
"This is generally recommended, as it helps reduce inter-test "
87+
"dependencies and assumptions about the environment's state"
88+
),
89+
)
90+
parser.add_argument(
91+
"--args", type=str, help="Additional arguments passed verbatim to 'pytest'."
8592
)
86-
parser.add_argument("--args", type=str, help="Additional args given to 'pytest'")
8793

8894

8995
def pytest_cmdline(args, config_path, output_path, reportlog_path):

0 commit comments

Comments
 (0)