Skip to content

Three test_imm_*.star fixtures are never executed, and one asserts impossible behaviour #564

Open

Description

@David-Noble-at-work

Three immediate-mode fixtures exist in cmd/devlore-test/devloretest/data/ and are referenced by no test:

  • test_imm_shell.star
  • test_imm_file.star
  • test_imm_file_join_variadic_error.star

Every other test_imm_*.star has a runScriptImm(t, ...) call in runner_test.go. These three do not.

One of them asserts behaviour that cannot happen

# test_imm_shell.star
result = shell.exec(command="echo hello")
t.expect_equal(result, "echo hello")
t.expect_unit_count(0)

shell is +devlore:access=planned, so it carries op.RoleAction without op.RoleModule, and
starlarkbridge.Runtime skips it when building predeclared globals:

if dispatch&op.RoleModule == 0 {
    // No module-mode dispatch; provider is not addressable as a top-level global.
    continue
}

So shell is not a top-level name and the script should fail on an undefined identifier -- never mind the
claim in its comment that "shell.exec returns the command string, not stdout", which is asserted nowhere and
true of nothing.

The cost was real: the fixture was read as evidence that immediate shell execution works, which sent an
investigation down a false path. A fixture that is never run is not merely uncovered -- it is a plausible-looking
assertion with nothing keeping it honest.

The other two are coverage, not fiction

file is access=both, so immediate file.* genuinely works and these two fixtures probably pass. They just
never run, which means the immediate half of the most-used provider in the codebase has no coverage from them.

Disposition

  • test_imm_shell.star -- delete. It encodes a wrong model, and the behaviour it wants is forbidden by
    2.4-hermeticity-guarantees.md.
  • test_imm_file.star, test_imm_file_join_variadic_error.star -- wire them into runner_test.go, or delete
    them if what they assert is covered elsewhere. Running them first will say which.

Worth checking in the same pass whether any other fixture in that directory is orphaned; these were found by
enumerating test_imm_* only.

Activity

  1. David-Noble-at-work commented on Sep 10, 2026

    @David-Noble-at-work
    ContributorAuthor

    Reconciling with #875 (merged), which I filed without first checking this issue existed — my error.

    Two of this issue's three concerns are now resolved:

    1. The "impossible behaviour" premise is stale. This issue says shell is +devlore:access=planned
      (RoleAction without RoleModule), so test_imm_shell.star "should fail on an undefined identifier."
      It no longer does — shell gained a runtime surface (the shell-provider Starlark surface, added
      2026-08-28). Verified today:

      $ go run ./cmd/devlore-test run .../data/test_imm_shell.star
        "passed": true
      

      shell.exec(...) returns a *Result whose fields are individually reachable. Three devlore-test fixtures assert text the runtime no longer produces; all three fail when run #875 rewrote the fixture
      to assert that (four fields, both streams, the "Result" render) instead of the old
      result == "echo hello" fiction.

    2. test_imm_file_join_variadic_error.star was also corrected by Three devlore-test fixtures assert text the runtime no longer produces; all three fail when run #875 (stale error text →
      'multiple values for argument "parts"').

    3. test_imm_file.star is now wired into the Go harness (runner_test.go:354), so it runs under
      make test.

    What remains of this issue: test_imm_shell.star and test_imm_file_join_variadic_error.star are still
    not referenced by runner_test.go — #875 fixed their assertions, not their wiring. So they pass when run by
    hand but nothing runs them automatically. That surviving slice is the same concern as #876 (nothing runs the
    data/*.star fixtures as a gate) and #664 (devlore-test run fails on a quarter of them).

    Recommendation (yours to make): close this as substantially resolved and let #876/#664 carry the
    "nothing runs them" concern, or narrow it to "wire the two remaining test_imm_* fixtures into
    runner_test.go." I did not touch its state.

  2. David-Noble-at-work commented on Nov 9, 2026

    @David-Noble-at-work
    ContributorAuthor

    star github triage sweep added this issue to Triage: devlore, for the rule it breaks:

    • no-evidence: no Evidence of completion section
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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions