Skip to content

Commit

Permalink
Update vt runner config after avocado runner config update
Browse files Browse the repository at this point in the history
This commit update vt runner config to be compatible with the
changes applied to the mainstream and the lts version as well.

Reference: avocado-framework/avocado#5494

Signed-off-by: Xu Han <[email protected]>
  • Loading branch information
luckyh committed Dec 8, 2022
1 parent b960704 commit 57fddeb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions avocado_vt/conf.d/vt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[run]
# The avocado-vt cannot be run in parallel,
# when this value will be >1 the vt tests won't be resolved.
max_parallel_tasks = 1

# The following section is for avocado <= 99.0
[nrunner]
# The avocado-vt cannot be run in parallel,
# when this value will be >1 the vt tests won't be resolved.
Expand Down
8 changes: 5 additions & 3 deletions avocado_vt/plugins/vt_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ def _get_reference_resolution(self, reference):
runnables = [self._parameters_to_runnable(d) for d in
cartesian_parser.get_dicts()]
if runnables:
if self.config.get("nrunner.max_parallel_tasks", 1) != 1:
warnings.warn("The VT NextRunner can be run only with "
"nrunner-max-parallel-tasks set to 1")
if self.config.get(
"run.max_parallel_tasks", self.config.get(
"nrunner.max_parallel_tasks", 1)) != 1:
warnings.warn("The VT NextRunner can be run only "
"with max-parallel-tasks set to 1")
return ReferenceResolution(reference,
ReferenceResolutionResult.SUCCESS,
runnables)
Expand Down
4 changes: 3 additions & 1 deletion avocado_vt/plugins/vt_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ def run(self, runnable=None):
self.runnable = runnable

yield messages.StartedMessage.get()
if self.runnable.config.get("nrunner.max_parallel_tasks", 1) != 1:
if self.runnable.config.get(
"run.max_parallel_tasks", self.runnable.config.get(
"nrunner.max_parallel_tasks", 1)) != 1:
yield messages.FinishedMessage.get('cancel',
fail_reason="parallel run is not"
" allowed for vt tests")
Expand Down
2 changes: 1 addition & 1 deletion docs/source/GetStartedGuide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ If there are missing requirements, please install them and re-run `vt-bootstrap`
.. warning:: When you bootstrap avocado-vt the parallel run of avocado nrunner
will be disabled by default, because the avocado-vt doesn't support
parallel tests. If you run test suite without vt tests, you can
enable parallel run by `nrunner.max_parallel_tasks` config variable.
enable parallel run by `run.max_parallel_tasks` config variable.

First steps with Avocado-VT
===========================
Expand Down

0 comments on commit 57fddeb

Please sign in to comment.