Show test results from compile-less singleton submissions#92
Merged
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.branch: "main"everywhere.Background
User-reported regression: searching
computer:VVEEGGAAreturned 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 recordscompiledonentire/emptysubmissions, so every VVEEGGAA submission landed withcompiled = nil._build_stati_by_computercompact-ed those nils away and skipped the computer, soper_computer_summaryproduced 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 onmainthe URL resolved (becausemainexists 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_computerfalls back to "implicitly built" when a computer has test_instances on this commit but no explicitcompiledsignal. 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_summarycovering the regression.app/helpers/test_instances_helper.rb— newbest_branch_name_for(commit)helper, prefersmainthen alphabetical.app/models/test_instance.rb—.querynow eager-loadscommit: :branchesso 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/test_instances/search?query_text=computer:VVEEGGAAlinks resolve to containing branches:0671b8f→/pgplot_residuals/commits/0671b8f43db327→/features/nialljmiller/customcolors_post/commits/43db327250d865,aa27a08→/main/commits/...0671b8f: BUILDS 0/0 → 1/1, 0 computers → 1250d865: BUILDS 2/2 → 3/3, 2 computers → 343db327: VVEEGGAA column now presentaa27a08: still works (had explicitcompiled=trueseparately)