f963b73576b5c69915366893da7dfa6afe633456 braney Sat Aug 8 14:04:23 2026 -0700 docent: add a tests directory and a browser-free derive mode, refs #37892 tests/ holds Docent scripts that assert with expect:, run by hand with `make test` rather than by the tree's test target, since each one drives a real server. Nine of them: the two-request composite split (#37953), hideKids on a view and on a superTrack, the cCREs expansion that once overran the request line, addCustomTrack, a 3x run, and the session/loadSession round trip. A script named *.xfail.docent.yaml is expected to fail, which is how the hideKids-aimed-at-the-composite trap is pinned rather than only written down, and how expect: itself is checked. DOCENT_DERIVE=1 prints what each track: step turns into and stops, with no browser and no navigation. That derivation is where most of Docent's own decisions are, and it was previously visible only in the log of a full run. `make derive` diffs it against baselines in tests/expected/ for the scripts whose derived set is small enough to be stable. The track: verb now calls trackRounds() for that derivation instead of doing it inline. No behaviour change intended; the tests above pass before and after. Two things the tests turned up, both recorded in tests/README.txt: turning on anything under a superTrack sends =show and undoes an earlier hide: all for its other members, and hideKids on a view has to enumerate leaves, so one such step sends 188 variables in a 6,986-character request. diff --git src/hg/utils/docent/tests/composite.docent.yaml src/hg/utils/docent/tests/composite.docent.yaml new file mode 100644 index 00000000000..fe2ef93ba8e --- /dev/null +++ src/hg/utils/docent/tests/composite.docent.yaml @@ -0,0 +1,25 @@ +# A composite named together with a deviation under it. +# +# hgTracks RESHAPES a composite when its container visibility changes, and that wipes +# per-subtrack overrides arriving in the same request: `clinvar=pack&clinvarCnv=hide` +# alone leaves clinvarCnv_sel=1 and the CNV row still drawn (#37953). Docent sends it +# in two rounds, container first. That split is invisible in the output, so this test +# is the only thing standing between it and a quiet regression. +target: genome-test +db: hg38 +position: chr17:43044295-43125364 +reset: true +fast: true +steps: + - go: chr17:43044295-43125364 + - hide: all + + # The container reaches its selected children on its own, so naming it draws all three. + - track: {clinvar: pack} + - expect: {rows: [clinvarMain, clinvarCnv, clinvarSubLolly]} + + # Now the same step with one deviation. clinvarCnv must go, the others must stay, and + # the container must NOT be turned off by the hide travelling upward. + - hide: all + - track: {clinvar: pack, clinvarCnv: hide} + - expect: {rows: [clinvarMain, clinvarSubLolly], noRows: [clinvarCnv], noText: "Too Long"}