- commit
- c8b191b00fe4ef574fcd2c7150033c9f320da46f
- parent
- 17c7f50e27294767e6f0890e1c8ba41e203ba2cd
- author
- Dami <dami.etoile@gmail.com>
- kind
- test risk score 1.4 of 3, Jev's estimate
| M | docs/ | 4 | ++-- |
| M | internal/ | 10 | +++++----- |
@@ -61,8 +61,8 @@ without them:
6161 6262 ```sh6363 npm install --prefix ~/.cache/o12-playwright playwright && npx --prefix ~/.cache/o12-playwright playwright install chromium-headless-shell64-O12_PLAYWRIGHT=~/.cache/o12-playwright go test ./internal/mcp -run TestViewInBrowser65-O12_VIEW_SHOTS=/tmp/shots O12_PLAYWRIGHT=~/.cache/o12-playwright go test ./internal/mcp -run TestViewInBrowser # and screenshots64+PLAYWRIGHT_DIR=~/.cache/o12-playwright go test ./internal/mcp -run TestViewInBrowser65+VIEW_SHOTS=/tmp/shots PLAYWRIGHT_DIR=~/.cache/o12-playwright go test ./internal/mcp -run TestViewInBrowser # and screenshots6666 ```6767 6868 ## End to end, through libghostty@@ -19,9 +19,9 @@ import (
1919 // MCP Apps hosts do, in Chromium through Playwright (testdata/view.mjs),2020 // and checks the grid, the pointer and formula bar, scrolling, the2121 // theme and the frame's height. It needs Node and the playwright22-// package, found through O12_PLAYWRIGHT (a folder whose node_modules22+// package, found through PLAYWRIGHT_DIR (a folder whose node_modules2323 // holds it) or NODE_PATH, and is skipped without them.24-// O12_VIEW_SHOTS names a folder for screenshots of each case.24+// VIEW_SHOTS names a folder for screenshots of each case.2525 func TestViewInBrowser(t *testing.T) {2626 if testing.Short() {2727 t.Skip("-short")@@ -63,7 +63,7 @@ func TestViewInBrowser(t *testing.T) {
6363 t.Fatal(err)6464 }6565 args := []string{filepath.Join("testdata", "view.mjs"), file}66- if shots := os.Getenv("O12_VIEW_SHOTS"); shots != "" {66+ if shots := os.Getenv("VIEW_SHOTS"); shots != "" {6767 args = append(args, shots)6868 }6969 cmd := exec.Command("node", args...)@@ -86,7 +86,7 @@ func playwrightPath(t *testing.T) string {
8686 t.Skip("no node")8787 }8888 var dirs []string89- if d := os.Getenv("O12_PLAYWRIGHT"); d != "" {89+ if d := os.Getenv("PLAYWRIGHT_DIR"); d != "" {9090 dirs = append(dirs, filepath.Join(d, "node_modules"), d)9191 }9292 if d := os.Getenv("NODE_PATH"); d != "" {@@ -96,7 +96,7 @@ func playwrightPath(t *testing.T) string {
9696 cmd := exec.Command("node", "-e", "require('playwright')")9797 cmd.Env = append(os.Environ(), "NODE_PATH="+nodePath)9898 if err := cmd.Run(); err != nil {99- t.Skip("no playwright package: set O12_PLAYWRIGHT to a folder whose node_modules holds it")99+ t.Skip("no playwright package: set PLAYWRIGHT_DIR to a folder whose node_modules holds it")100100 }101101 return nodePath102102 }