Skip to content

test(cross-major): extract the shared manager harness into gvm_extra - #49

Merged
kp2pml30 merged 1 commit into
genlayerlabs:feat/manager-socket-trainfrom
HusseinAdeiza:extract-cross-major-harness
Oct 6, 2026
Merged

kp2pml30 merged 1 commit into
genlayerlabs:feat/manager-socket-trainfrom
HusseinAdeiza:extract-cross-major-harness

Conversation

@HusseinAdeiza

Copy link
Copy Markdown
Contributor

Closes #16.

cross-major-observability drove the manager by loading cross-major/test.py
through importlib.util.spec_from_file_location and then reaching across that
module boundary for ten names, eight of them private:

def _load_cross_major_harness():
	path = Path(__file__).parents[1] / 'cross-major' / 'test.py'
	...
base = _load_cross_major_harness()

The path coupling breaks silently if the sibling directory is renamed, and the
duplication was already real: the observability case carried its own _execute
and _lvs_extended because the originals could not be parameterized.

tests/runner/gvm_extra/ is already on the test path, so the shared mechanism
moves there as gvm_extra/cross_major.py. Each case keeps its own fixtures,
addresses and assertions.

What changed

Three deliberate changes let one definition serve both cases:

  • _execute grows a permissions argument, so the observability override
    disappears. It is only sent when a case asks for it, which leaves
    cross-major's request payload unchanged.
  • host_data's tx_id becomes host_data_tx_id, set by a new _setup helper,
    so each case labels its own runs.
  • _lvs takes **kwargs instead of naming four parameters, which is what
    _lvs_extended existed for.

Every other moved body is byte-identical apart from the _TestContext to
TestContext rename. contract_source now requires assets_dir rather than
defaulting it, because the two cases keep assets in different directories.

Net: 429 insertions, 465 deletions, one definition of each helper, no
importlib and no base._ reach-through.

Verification

Collected both cases before and after, then diffed name, method, fixtures,
arguments and tags:

baseline after
cross-major 20 cases 20 cases, identical
cross-major-observability 23 cases 23 cases, identical

ruff check on the three files is at parity with the pre-change baseline. The
one remaining BLE001 predates this change and is left alone.

Unrun: the runner-artifact tier. Runner artifacts build on Linux only and
were not built here, so per the review-ready bar that tier is reported as
unrun, not passed. The full integration matrix needs the ci-safe label.

Note on scope

The issue listed ManagerProc and PY_GENLAYER_V03 among the names to extract.
Neither exists in the tree any more, so the live surface was ten names, not
eight-plus-constants. Left the remaining case-specific assertions alone.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (3)
  • main
  • v\d+.\d+
  • v\d+.\d+-dev

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: genlayerlabs/genvm-manager/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 191eada8-6da5-451f-a34e-88d237c60496

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

GenVM PR actions

Tick a box to run it (the box unticks itself when handled). Actions only run while the PR has the ci-safe label.

  • Force run full tests
  • Provision executor PRs
Commands
  • /genvm-run-tests — run full tests once for the current manager snapshot
  • /merge — queue the exact manager snapshot through the App-owned E2E merge train

@github-actions github-actions Bot added the not rebased branch is behind its base; rebase before it can be merged label Sep 30, 2026
`cross-major-observability` drove the manager by loading
`cross-major/test.py` through `importlib.util.spec_from_file_location`
and then reaching across that module boundary for ten names, eight of
them private. The path coupling breaks silently if the sibling directory
is renamed, and the duplication was already real: the observability case
carried its own `_execute` and `_lvs_extended` because the originals
could not be parameterized.

`tests/runner/gvm_extra/` is already on the test path, so the shared
mechanism moves there as `gvm_extra/cross_major.py`: the case and step
bases, the call encoding helpers, and the host plumbing. Each case keeps
its own fixtures, addresses and assertions.

Three deliberate changes let one definition serve both cases:

- `_execute` grows a `permissions` argument, so the observability
  override disappears. It is only sent when a case asks for it, which
  keeps cross-major's request payload unchanged.
- `_execute`'s `host_data` tx_id becomes `host_data_tx_id`, set by the
  new `_setup` helper, so each case labels its own runs.
- `_lvs` takes `**kwargs` instead of naming four parameters, which is
  what `_lvs_extended` was for.

Every other moved body is byte-identical apart from the `_TestContext`
to `TestContext` rename.

Verified by collecting both cases before and after and diffing name,
method, fixtures, arguments and tags: 20 cross-major and 23
observability cases, identical in both runs. `ruff check` is at parity
with the pre-change baseline (the one remaining BLE001 predates this
change).

The runner-artifact tier is unrun: runner artifacts build on Linux only
and this was not built locally.

(cherry picked from commit 309d45c)
@HusseinAdeiza
HusseinAdeiza force-pushed the extract-cross-major-harness branch from 309d45c to cdcc297 Compare September 30, 2026 05:36
@github-actions github-actions Bot added not rebased branch is behind its base; rebase before it can be merged and removed not rebased branch is behind its base; rebase before it can be merged labels Sep 30, 2026
@kp2pml30
kp2pml30 changed the base branch from v0.6-dev to feat/manager-socket-train October 6, 2026 09:22
@github-actions github-actions Bot removed the not rebased branch is behind its base; rebase before it can be merged label Oct 6, 2026
@kp2pml30
kp2pml30 merged commit 1dff5e2 into genlayerlabs:feat/manager-socket-train Oct 6, 2026
6 checks passed
@kp2pml30

kp2pml30 commented Oct 6, 2026

Copy link
Copy Markdown
Member

Thanks! Landed via the feat/manager-socket-train train (#58), reworked after review with you credited as co-author; it reaches v0.6-dev when #58 merges

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.

2 participants