Skip to content

Show test results from compile-less singleton submissions#92

Merged
wmwolf merged 1 commit into
masterfrom
fix-singleton-submission-visibility
May 26, 2026
Merged

Show test results from compile-less singleton submissions#92
wmwolf merged 1 commit into
masterfrom
fix-singleton-submission-visibility

Conversation

@wmwolf
Copy link
Copy Markdown
Member

@wmwolf wmwolf commented May 26, 2026

Summary

  • Commit summary matrix now includes computers whose only submissions were singleton (test-by-test) submissions with compiled = nil. Running a test implies a successful build, so any computer with test instances on a commit is treated as implicitly built when no explicit compile signal exists.
  • Test-instance search results now link to a branch that actually contains each commit, instead of hardcoding branch: "main" everywhere.

Background

User-reported regression: searching computer:VVEEGGAA returned 112 passing test instances across 4 commits, but clicking through to those commits, three of them showed no VVEEGGAA column at all. Niall's client submits results test-by-test; SubmissionsController#create only records compiled on entire / empty submissions, so every VVEEGGAA submission landed with compiled = nil. _build_stati_by_computer compact-ed those nils away and skipped the computer, so per_computer_summary produced no row and the matrix view rendered no column.

The data was always intact — the test_case_commit page rendered VVEEGGAA's row fine — but the commit overview made it invisible.

While in there, the search results page hardcoded branch: "main" in every commit/test-case link. For commits not on main the URL resolved (because main exists as a branch) but rendered the commit in main's context. Now picks a containing branch.

Changes

  • app/models/concerns/commit_state.rb_build_stati_by_computer falls back to "implicitly built" when a computer has test_instances on this commit but no explicit compiled signal. A bare singleton with no instances still falls through to :unknown.
  • spec/models/commit_state_spec.rb — two new specs in #build_status (implicit-built + still-unknown guard) and one in #per_computer_summary covering the regression.
  • app/helpers/test_instances_helper.rb — new best_branch_name_for(commit) helper, prefers main then alphabetical.
  • app/models/test_instance.rb.query now eager-loads commit: :branches so the search view doesn't N+1.
  • app/views/test_instances/search.html.haml — uses the helper for commit + test_case links.

Test plan

  • bundle exec rspec — 307 examples, 0 failures
  • Verified /test_instances/search?query_text=computer:VVEEGGAA links resolve to containing branches:
    • 0671b8f/pgplot_residuals/commits/0671b8f
    • 43db327/features/nialljmiller/customcolors_post/commits/43db327
    • 250d865, aa27a08/main/commits/...
  • Verified VVEEGGAA now visible on all four commit pages (was hidden on 3 of 4 before)
    • 0671b8f: BUILDS 0/0 → 1/1, 0 computers → 1
    • 250d865: BUILDS 2/2 → 3/3, 2 computers → 3
    • 43db327: VVEEGGAA column now present
    • aa27a08: still works (had explicit compiled=true separately)

Test-by-test clients submit each result as its own Submission with
no `entire`/`empty` flag, so the controller never records a
`compiled` value. _build_stati_by_computer used to compact those
nils away and drop the computer entirely, so per_computer_summary
returned no row for it and the matrix view rendered no column —
the test instances were unreachable from the commit page even
though they were intact in the database (and visible to the test
instance search).

Running a test implies a successful build, so treat any computer
with test instances on a commit as implicitly built when no
explicit compile signal exists. A bare singleton with no instances
still falls through to :unknown.

While here, fix the search results page hardcoding branch="main"
on every commit/test-case link. For commits that don't live on
main the resulting URL renders in main's context (the controller's
branch-fallback only fires when the named branch itself doesn't
exist). Pick a containing branch instead — main when available,
otherwise the alphabetically-first branch — and eager-load
commit.branches in TestInstance.query to avoid an N+1.
@wmwolf wmwolf merged commit 436ffb4 into master May 26, 2026
1 check passed
wmwolf added a commit that referenced this pull request May 26, 2026
- Spec count 263 → 336.
- New reality-check: singleton submissions with `compiled=nil` are
  treated as built when test_instances exist (PR #92).
- New reality-check: commit-page URLs whose branch doesn't contain
  the SHA redirect to a containing branch via
  `Commit#preferred_branch` + the `BranchMismatchRedirect` concern,
  with the redirect target documented as main → most-recent-head
  → alphabetical (PR #93). Search results use the same precedence
  via `TestInstancesHelper#best_branch_name_for`.
- New reality-check: only `runtime_minutes` is populated by the
  ingest factory; `runtime_seconds`, `re_time`, and
  `total_runtime_seconds` are dead schema columns and any read or
  filter that hits them silently returns nothing. Documents what
  the search-runtime fix (PR #94) is restoring.
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.

1 participant