Skip to content

Functest: Add parallel step execution - #1100

Open
elizashurov wants to merge 6 commits into
HCK-CI:masterfrom
elizashurov:parallel-step-execution
Open

Functest: Add parallel step execution#1100
elizashurov wants to merge 6 commits into
HCK-CI:masterfrom
elizashurov:parallel-step-execution

Conversation

@elizashurov

Copy link
Copy Markdown
Contributor

Summary

Adds a parallel step type that runs two or more named branches
concurrently, for tests that need several things happening at once instead of forcing everything
to run one step at a time.

  • ParallelBlock model and CommandInfo#step_type_active? /
    #deep_dup, centralizing step-type detection in CommandInfo.
  • BranchContext + ParallelBranchRunner execute each branch in its
    own thread and isolated context; captured variables are only shared
    with the rest of the test once every branch finishes.
  • Load-time validation (conflicting clients, nested parallel,
    disallowed step types inside a branch, duplicate capture_output
    names, etc.) fails fast with a clear error before the test runs.
  • fail_fast (default true) controls whether one branch's failure
    cancels the others; functest_results.json reports each branch's
    status and steps individually.
  • Docs updated with the new step type's schema, constraints, and
    result format.
  • New dummy_ci test case exercising a host+guest parallel block in CI.

@elizashurov
elizashurov requested a review from kostyanf14 August 11, 2026 16:24
Comment thread lib/engines/functest/test_executor.rb Fixed
Comment thread lib/engines/functest/parallel_branch_runner.rb Fixed
Comment thread lib/engines/functest/parallel_branch_runner.rb Fixed
Comment thread lib/engines/functest/parallel_branch_runner.rb Fixed
Comment thread lib/engines/functest/parallel_branch_runner.rb Fixed
Comment thread lib/engines/functest/parallel_branch_runner.rb Fixed
@elizashurov
elizashurov force-pushed the parallel-step-execution branch from 986294f to dcb790d Compare August 12, 2026 07:49
Comment thread lib/engines/functest/parallel_branch_runner.rb Fixed
@elizashurov
elizashurov force-pushed the parallel-step-execution branch 2 times, most recently from 5f46dbb to cd6414d Compare August 12, 2026 09:33
@kostyanf14
kostyanf14 requested a balanced review from Copilot August 12, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds parallel branch execution to Functest with isolated variable contexts, validation, result reporting, documentation, and CI coverage.

Changes:

  • Introduces the parallel step model and concurrent branch runner.
  • Adds validation, capture merging, and per-branch results.
  • Documents and exercises host/guest parallel execution.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
lib/models/command_info.rb Adds parallel models and deep-copy helpers.
lib/auxiliary/command_execution_manager.rb Registers the parallel step type.
lib/engines/functest/branch_context.rb Isolates branch variables.
lib/engines/functest/parallel_branch_runner.rb Runs and reports concurrent branches.
lib/engines/functest/step_handler.rb Dispatches parallel steps.
lib/engines/functest/test_executor.rb Validates and reports parallel blocks.
lib/engines/functest/test_case.rb Labels and duplicates branch steps.
lib/engines/functest/functest.rb Loads parallel execution components.
lib/engines/functest/tests/cases/dummy_ci/parallel_host_guest.json Adds a parallel CI scenario.
lib/engines/functest/tests/suites/dummy.json Includes the new scenario.
docs/Functest-Engine.md Documents schema, constraints, and results.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/engines/functest/test_executor.rb
Comment thread lib/engines/functest/test_executor.rb
Comment thread lib/engines/functest/test_executor.rb
Comment thread lib/engines/functest/test_executor.rb Outdated
Comment thread lib/engines/functest/parallel_branch_runner.rb Outdated
Comment thread lib/engines/functest/parallel_branch_runner.rb Outdated
Comment thread lib/engines/functest/tests/suites/dummy.json
Comment thread docs/Functest-Engine.md Outdated
Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
Adds the ParallelBlock struct for a parallel step's named branches and
fail-fast behavior, and registers `parallel` as a new CommandInfo step
type.

Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
@elizashurov
elizashurov force-pushed the parallel-step-execution branch from cd6414d to 93778fd Compare August 12, 2026 13:01
Adds a `parallel` step type that runs two or more named branches
concurrently, each in its own thread, for tests that need several
things happening at once.

`BranchContext` gives each branch its own isolated `TestContext`, so
variables captured mid-branch aren't visible to the others until the
branch finishes.

`ParallelBranchRunner` runs one thread per branch and waits for all of
them to finish before returning. By default (`fail_fast: true`), one
branch's failure cancels every other branch still running.

Docs updated with the new step type's schema, constraints, and result
format.

Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
Tools#act_with_tools held one global mutex for the whole call, so
actions on different clients (e.g. two `parallel` branches) were
serialized even though RToolsHCK opens an independent connection per
machine call and shares no state between them.

MachineLocks now hands out one mutex per machine name, and
act_with_tools_on_machine uses it instead of the global lock,
so different machines run concurrently while same-machine calls
still serialize. Studio/pool-level actions still share one
connection and keep the global lock via act_with_tools.

Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
@elizashurov
elizashurov force-pushed the parallel-step-execution branch from 93778fd to 818d95e Compare August 16, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants