Pabot 5.1.0 has some extra debug print in console
After pabot 5.1.0 release, pabot's _report_results_for_one_run() function has extra print _write(pabot_args) which should be used only for debugging during development. That line should be removed from next release.
Would it make sense to also remove _write("Note: The ordering file contains test or suite items that are not included in the current test run. The following items will be ignored/skipped:"), which could print several unwanted lines when user intentionally wants to run a smaller subset of tests.
That’s a bit of a double-edged issue. The print statement was originally added because there were cases where users were confused about why the entire contents of the --ordering file weren’t being executed, or similar situations. After all, the ordering file — as its name and documentation state — is only meant to define execution order, not to select which tests should be run.
The best overall solution would be to add a proper logging mechanism to Pabot instead of relying solely on console output (for example, using Python’s built-in logging module). That way, such messages could be logged at a DEBUG level instead of being printed directly to the console.
Well, --ordering can also be used to selectively use testlevelsplit for selected suites. Doing this will inherently issue this warning for all the selected test items which are included in ordering file
Note: The ordering file contains test or suite items that are not included in the current test run. The following items will be ignored/skipped:
- Test item: 'Suite 1.Concurrent.Concurrent Test 1'
- Test item: 'Suite 1.Concurrent.Concurrent Test 2'
looks a simple fix can help to suppress those, essentially we don't print this warning as long as a parent suite is included.
diff --git a/src/pabot/pabot.py b/src/pabot/pabot.py
index f69ffc6..1f4caaa 100644
--- a/src/pabot/pabot.py
+++ b/src/pabot/pabot.py
@@ -2215,7 +2215,7 @@ def _check_ordering(ordering_file, suite_names): # type: (List[ExecutionItem],
if ordering_file:
for item in ordering_file:
if item.type in ['suite', 'test']:
- if not any((s == item.name or s.endswith("." + item.name)) for s in list_of_suite_names):
+ if not any((s == item.name or s.endswith("." + item.name) or (item.type == 'test' and item.name.startswith(s + "."))) for s in list_of_suite_names):
# If test name is too long, it gets name ' Invalid', so skip that
# Additionally, the test is skipped also if the user wants a higher-level suite to be executed sequentially by using
# the --suite option, and the given name is part of the full name of any test or suite.