Skip to content

Establish root test fixtures for repeated process and environment setup #8289

Closed

Description

@jyaunches

Objective

Reduce repeated root-test setup without hiding scenario inputs or assertions.

Sequential PRs

  1. Add an onboarding child-process harness for four pilot suites.
  2. Add an in-memory onboarding-machine runtime fixture.
  3. Add an installer checkout and npm-stub builder.
  4. Add a fresh-object OpenClaw environment fixture and canonical corporate-CA test asset.

Expected combined net reduction: 1,130–1,700 LOC.

Relationships

Acceptance criteria

  • Helpers own setup mechanics only.
  • Scenario inputs and behavior assertions remain in each test.
  • Helpers return fresh mutable objects.
  • Helpers restore environment and global state.
  • No generic mock DSL or automatic behavioral default is added.
  • Each migration has a negative net LOC delta.

Validation

Run affected integration and source tests, installer tests where applicable, npm run test:shuffle, and npm run test:projects:check.

Activity

  1. added
    area: architecture
    area: onboarding
    help wanted
    on Aug 5, 2026
  2. added theissue type on Aug 5, 2026
  3. JulienAu commented on Aug 7, 2026

    @JulienAu
    Contributor

    I'd like to take sequential PR 1, the onboarding child-process harness. Following up from #8290, which established the fixture conventions this epic's maintainer audit endorsed.

    Plan for the pilot:

    • Add a support module owning the child-process setup mechanics the onboarding suites currently hand-roll: temporary home creation and cleanup, fake-bin directory with a stub writer, environment composition (HOME, PATH prepend, deterministic vars), a spawn runner returning status and output, and registry/session readers.
    • Pilot on four suites with the same inline shape: onboard-remote-recreate-credential-reuse, onboard-reservation-recreate, onboard-prepared-gateway-handoff, and onboard-gateway-port-conflict-fast-fail.
    • Stub script contents, scenario env values, and assertions stay in each test per the acceptance criteria; helpers return fresh state and restore the environment.

    Will open the PR once the affected suites pass in normal and shuffled order with a negative net LOC delta.

  4. JulienAu commented on Aug 7, 2026

    @JulienAu
    Contributor

    Sequential PR 1 is up as #8537. Continuing with sequential PR 2, the in-memory onboarding-machine runtime fixture; I will open it once PR 1 lands so any review conventions from PR 1 carry over.

  5. jyaunches commented on Aug 20, 2026

    @jyaunches
    ContributorAuthor

    Completion review

    All four planned migrations merged:

    PR #8881 later consolidated the remaining host-process scenarios and removed 697 net lines.

    The acceptance review found:

    • Migrated test files have negative line deltas. New helpers own setup mechanics only.
    • Scenario inputs and behavior assertions remain in the owning tests.
    • Fixture tests cover fresh objects, environment isolation, cleanup, and caller-owned state.
    • The changes add no generic mock DSL or automatic behavior default.
    • Each PR records targeted test, type-check, repository-check, and documentation writer review evidence.

    PR #8559 records the remaining scope decision. It did not create a shared corporate-CA asset because the PEM blocks are scenario-specific. Sharing one block would change the tested certificate content.

    Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: architecturearea: onboardinghelp wanted

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions