3d8157de7ba1d2e846856deda743e0aae39b0dda
braney
  Tue Aug 25 16:31:36 2026 -0700
docent: use the shared Playwright install instead of a private ~/pwrec tree, refs #38188

PW_ENV in docent.mk and in the tests makefile named $(HOME)/pwrec, a tree that
only existed in one home directory, so nobody else could run docent or its
tests without setting the variable by hand. Both now default to
/hive/groups/browser/uiTest/pw, one pinned copy of playwright, chromium,
ffmpeg and js-yaml shared by every browser-driving test in the tree. A new
PW_DIR variable still points either makefile at a private install.

Nothing in docent.js changes except two comment lines. All nine docent tests
and all three derivation baselines pass against the shared pin.

diff --git src/hg/utils/docent/tests/makefile src/hg/utils/docent/tests/makefile
index 01d6bca5c29..b8469f93fd0 100644
--- src/hg/utils/docent/tests/makefile
+++ src/hg/utils/docent/tests/makefile
@@ -3,31 +3,32 @@
 # network and the shared Playwright install. Run it by hand.
 #
 #     make test               # every *.docent.yaml here
 #     make test T=composite   # just one
 #     make parity             # same script FAST and slow, and twice over
 #
 # A test passes by exiting 0. It fails when an `expect:` step does not hold, which
 # names what it wanted and what was actually drawn, and exits 1.
 #
 # A script named *.xfail.docent.yaml is expected to FAIL, and the run fails if it
 # passes. That is how a documented trap gets pinned: views.xfail asserts that
 # `hideKids` aimed at the composite really does lose the row, so the day that
 # changes, someone is told rather than left to notice.
 
 DOCENT ?= ../docent.js
-PW_ENV ?= PLAYWRIGHT_BROWSERS_PATH=$(HOME)/pwrec/browsers NODE_PATH=$(HOME)/pwrec/node_modules
+PW_DIR ?= /hive/groups/browser/uiTest/pw
+PW_ENV ?= PLAYWRIGHT_BROWSERS_PATH=$(PW_DIR)/browsers NODE_PATH=$(PW_DIR)/node_modules
 T      ?=
 TESTS  := $(if $(T),$(addsuffix .docent.yaml,$(T)),$(wildcard *.docent.yaml))
 
 .PHONY: test parity clean
 
 test:
 	@fail=0; \
 	for f in $(TESTS); do \
 	  b=$${f%.docent.yaml}; want=0; \
 	  case $$b in *.xfail) want=1;; esac; \
 	  if [ $$want = 1 ]; then printf '=== %s (expected to fail)\n' "$$b"; \
 	  else printf '=== %s\n' "$$b"; fi; \
 	  $(PW_ENV) node $(DOCENT) $$f > $$b.log 2>&1; got=$$?; \
 	  if [ $$got -ne 0 ] && [ $$want -eq 0 ]; then \
 	    echo "  FAILED -- run said:"; sed 's/^/    /' $$b.log; fail=1; \