Fail to speed up CI by not installing Chrome.
I have no idea why the same "vintage" machine I logged into via tmate
has this working, but this doesn't, but the --no-sandbox thing is
correct regardless.
Variants of the following is what SHOULD work but doesn't yet.
PATH=/usr/local/share/chromium/chrome-linux:$PATH GOEXPERIMENT=synctest stdbuf -oL -eL go test -v -count=1 -run TestBrowserInitialization ./claudetool/browse/...
diff --git a/.github/workflows/go_test.yml b/.github/workflows/go_test.yml
index 8ea2e03..454ab69 100644
--- a/.github/workflows/go_test.yml
+++ b/.github/workflows/go_test.yml
@@ -40,6 +40,9 @@
go install gotest.tools/gotestsum@latest
go install mvdan.cc/gofumpt@latest
go install golang.org/x/tools/cmd/goimports@latest
+ # Empirically (by logging into runners with tmate), there are versions of Chromium/Chrome in /opt/google/chrome
+ # and /usr/local/share/chromium/chrome-linux. However, adding them to the PATH
+ # hasn't worked yet. I don't know why.
sudo apt-get update && sudo apt-get -y install chromium
- name: Go generate
diff --git a/claudetool/browse/browse.go b/claudetool/browse/browse.go
index 5cd28cd..9ab1ae3 100644
--- a/claudetool/browse/browse.go
+++ b/claudetool/browse/browse.go
@@ -71,6 +71,10 @@
b.initOnce.Do(func() {
// ChromeDP.ExecPath has a list of common places to find Chrome...
opts := chromedp.DefaultExecAllocatorOptions[:]
+ // This is the default when running as root, but we generally need it
+ // when running in a container, even when we aren't root (which is largely
+ // the case for tests).
+ opts = append(opts, chromedp.NoSandbox)
allocCtx, _ := chromedp.NewExecAllocator(b.ctx, opts...)
browserCtx, browserCancel := chromedp.NewContext(
allocCtx,