tests: update README.md for symbol history
tests/README.md is updated with instructions on running and modifying
tests/api.
Trust: Julie Qiu
Run-TryBot: Julie Qiu
TryBot-Result: kokoro
@@ -42,6 +42,34 @@ search/importedby.txt. The file has the format:
It is expected that the modules for these packages are in
tests/search/seed.txt.
+## Symbol History API Tests
+
+The tests/api/scripts directory contains tests that are run
+using tests/api/run.sh.
+
+The tests compare API data for a module `tests/api/testdata` with the API
+history on the frontend versions page. The frontend that is used for comparison
+must have `GO_DISCOVERY_SERVE_STATS` set so that the
+`/<path>?tab=versions&m=json` endpoint is available.
+
+### Adding a package
+
+Data in `tests/api/testdata` is generated by running:
+
+```
+go run tests/api/main.go generate [module path]:[package path suffix]
+```
+
+For example, `go run tests/api/main.go generate
+github.com/julieqiu/api-demo:pkg` for package `github.com/julieqiu/api-demo/pkg`.
+
+This data can now be used to check the API history on a frontend by running:
+
+```
+go run tests/api/main.go compare [module path]:[package path suffix]
+```
+
+
## End-to-End (E2E) Tests
Th e2e/ directory contains end-to-end tests for pages on pkg.go.dev, which can
