Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 2.09 KB

README.md

File metadata and controls

49 lines (34 loc) · 2.09 KB

golangorg

Local Development

For local development, simply build and run. It serves on localhost:6060. You can specify the domain name as the first path element, such as http://localhost:6060/go.dev/blog.

go run .

Testing

The go.dev and golang.org web sites have a suite of regression tests that can be run with:

go test golang.org/x/website/...

Test cases that check for expected URLs, content, response codes and so on are encoded in *.txt files in the testdata directory. If there is a problem that no existing test caught, it can be a good idea to add a new test case to avoid repeat regressions.

These tests can be run locally, via TryBots, and they are also run when new versions are being deployed. The testdata/live.txt file is special and used only when testing a live server, because its test cases depend on production resources.

Screentest

The go.dev web site has a suite of visual checks that can be run with:

./cmd/golangorg/screentest.sh

These checks can be run locally and will generate visual diffs of web pages from the set of test cases in cmd/golangorg/testdata/screentest/*.txt, comparing screenshots of the live server and a locally running instance of cmd/golangorg. Screentest will start Chrome locally to render the pages, but that can be unreliable. Prefer Chrome headless-shell. See the documentation at the top of cmd/screenshot/main.go for more.

Deploying to go.dev and golang.org

Each time a CL is reviewed and submitted, the site is automatically deployed to App Engine. If it passes its serving-readiness checks, it will be automatically promoted to handle traffic. Whether it passes or not, the new deployment can be found in the App Engine versions list.

If the automatic deployment is not working, or to check on the status of a pending deployment, see the “website-redeploy-golang-org” trigger in the Cloud Build console.