Skip to content

Test: join GUI, CLI and env contracts so the two halves cannot drift apart #3398

Open

Description

@VijitSingh97

What's the problem

Each half of a GUI/CLI/env contract is pinned by its own fixture, and nothing tests the join. The two defects that exposed this are fixed, but each fix carries separate tests on the two sides:

Owner rulings of 2026-10-27: every page moves to the new Sovereign UI, nothing is added to the current dashboard UI. This issue is test-only and targets the server contracts and the new pages (#3566).

What it impacts

How I found it

How important is it

Medium. Test debt on the test track: it never blocks a ship, and its value is highest once the profile contract and the Settings page exist. Cost: a few small tests, seconds of CI runtime.

Acceptance criteria

Items 1 to 3 need no new UI and can land first as a PR on develop-v2.1.0; item 4 follows #2530. The issue closes when all four are done.

  • 1. Connection parity: one committed fixture under dashboard/tests/ (the dashboard image's test stage sees only that tree) holds rows for a wildcard bind, a specific interface bind and a loopback bind, each with the expected advertised host and the local-only flag. Both the CLI announce test (announce_dashboard_url) and the endpoint test read it, and each fails when it disagrees with a row. The rendering of the endpoint's answer on the Machines card stays in Sovereign: make the machines view usable for 2, 50 and 100 workers #2517's own tests.
  • 2. Env plumbing: a tier-1 check asserts that every variable the dashboard reads through os.environ or its config module is passed by both the compose dashboard service and the rendered Quadlet unit, or appears on a named allowlist in the test with a reason per entry (for example the DIY-only notification and XvB variables). The existing parse-control row stays so an empty parse cannot pass. Dropping the stratum bind from either render, or adding a read variable to one render only, turns it red.
  • 3. Default keys, server side: pytest asserts that read_config()'s _default_keys for the minimal host fixture equals a committed golden file under dashboard/tests/.
  • 4. Default keys, new Settings (after Sovereign: organize mining and advanced settings without losing fields #2530): the save test of the new Settings commit flow loads that golden file as the served _default_keys, changes one field, and requires the body shown in the preview-and-confirm dialog to hold exactly the explicit config plus that one change, with no untouched workers.list, notifications.webhooks or other default array or empty container written. The test runs with the editor on, as on the appliance and on DIY with a login.
  • 5. Negative controls: for each of items 1 to 4 the PR quotes a red run caused by one deliberate break (revert the bind rule in stratum_endpoint(), drop the variable from one render, drop an array default from read_config(), make the client send an untouched default) and the green run without it. This replaces the old red-on-develop proofs, which are moot now that both fixes are merged.
  • 6. The new tests are registered in their tier-1 suites and run in required CI; the PR quotes the CI run ids.
  • 7. No change to the current dashboard UI, its frontend tests or fixtures (the cutover Sovereign: verify complete feature coverage, accessibility and migration #2547 deletes them), no second CLI-versus-browser setup parity test (reuse the golden file Ask three questions at setup on the CLI and in the browser wizard #3577 adds if it exists), no hostnames, addresses or ports in fixtures beyond reserved documentation values, and no explanatory source comments.

Possible solutions

  • Parity fixture: a small JSON file with one object per bind row; the bash test reads it with jq, the pytest parametrizes over it. If a row needs the host address, the fixture names it explicitly so both sides use the same value.
  • Env audit: collect the names the dashboard reads from its Python source, compare them with the compose dashboard service's environment and the rendered Quadlet unit, and subtract the allowlist. Extend or replace the DASHBOARD_ cluster check in tests/stack/test-render-quadlet.sh and the compose test in tests/stack/standalone/test_compose.sh rather than adding a third copy. Compose is allowed to carry more than the appliance unit, so the check is a subset test with an allowlist, not equality.
  • Golden file: generate it once from the minimal host fixture and commit it, so a change to the defaults shows up as a reviewed diff. The Settings test then needs no copy of the server rule.
  • Land items 1 to 3 as one PR now and item 4 as a stacked PR after Sovereign: organize mining and advanced settings without losing fields #2530.
Earlier scope, kept as evidence only (superseded 2026-10-27; do not implement from it)

What's the problem

Test debt from 2.0.0 RC testing, for 2.0.1 (owner, 2026-10-11: every defect an RC cut finds must be caught by automated tests going forward).

What slipped
Each half of a GUI/CLI/env contract is pinned by its own fixture or by a private copy of the other half. Nothing tests the join.

  • Dashboard advertises LAN stratum URL for loopback-only listener #3384 (RC4): with the stratum listener bound to loopback only, the "Connect a miner" card shows the host LAN address, while the CLI prints the loopback address and "local connections only" (tests/stack/test-connection-announce.sh:49-52). The dashboard never receives the bind variable (dashboard/mining_dashboard/web/miner_connection.py:11-25, docker-compose.yml:774 and lib/pithead/36-quadlet-units.sh:382 carry only the port).
  • Dashboard config save adds untouched default arrays to minimal configs #3355 (RC3, since closed): a one-field save wrote untouched workers.list and notifications.webhooks. The fix's two tests each recompute the default-key rule: pytest (dashboard/tests/service/test_config_operations.py:64-106) strips and prunes as the client does, and the node test (dashboard/tests/frontend/config/configpayload.test.mjs:94-119) derives keys with its own copy of the server rule.

what it impacts

Where it runs
Tier-1 CI, all required: "Dashboard tests (pytest + coverage)", "Frontend logic tests (node --test)", "Compose config + security hardening", "Shell tests (pithead suite)".

How I found it

Discovery details are not separately established in the existing report; preserve and verify the evidence already recorded.

how important is it

Cost
M. Seconds of runtime.

acceptance criteria

Done when

possible solutions

Test to build

  1. GUI/CLI parity table: one fixture file under dashboard/tests/ (the dashboard image's test stage sees only dashboard/), read by tests/stack/test-connection-announce.sh (announce_dashboard_url) and dashboard/tests/web/test_miner_connection.py. Rows: wildcard bind, a specific interface (192.0.2.10), loopback; the URL and the local-only note must agree. Add a case in dashboard/tests/frontend/workers/minerconnection.test.mjs.
  2. Env plumbing: extend the DASHBOARD_ cluster check (tests/stack/test-render-quadlet.sh:79-92) and tests/stack/standalone/test_compose.sh:446-451 so every variable the dashboard reads through os.environ is passed by compose and by the Quadlet unit, or sits on a named allowlist.
  3. Golden file: pytest asserts read_config()'s _default_keys for the minimal host fixture equals a committed file; dashboard/tests/frontend/config/configview-save.test.mjs loads it as the served _default_keys, edits cost_per_kwh, and requires the previewed body to hold exactly the explicit config plus that edit.

Activity

  1. added this to the v2.x - post-GA milestone on Oct 11, 2026
  2. added
    dashboard
    testing
    on Oct 11, 2026
  3. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    Contributor

    Parked in Icebox under the lean roadmap (owner, 2026-10-21): this tests a surface that v2.1.0 reshapes, so writing it now means rewriting it; the feature PRs carry their own tests.

  4. added
    operator-action
    on Oct 27, 2026
  5. added
    blocked
    on Oct 27, 2026
  6. removed
    operator-action
    on Oct 27, 2026
  7. pithead-developer commented on Nov 16, 2026

    @pithead-developer
    Contributor

    Blocked on #2530.
    Blocked on #3557.

    Parked until the lean UI lands (see the park comment above). The native blocked-by links already hold it, and the tick removes blocked when every listed issue closes.

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

    blockeddashboardtesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions