x/pkgsite: add testcase for stdlib shortcut in frontend.TestServer #39663
In frontend.servePackagePageNew, we make a call to s.stdlibPathForShortcut so that the request will redirect if it makes a stdlib shortcut. For example, a request to pkg.go.dev/http will redirect to pkg.go.dev/net/http.
We should add a test case for this in frontend.TestServer.
The text was updated successfully, but these errors were encountered:
With this change, the flow of TestServer() is simplified: decision logic whether a test should be run (based on enabled experiments) is moved to testServer(). Required experiments can be specified when creating individual test cases in serverTestCases(). This should make the process of adding new tests more transparent (experiments can be allowed on the test case itself) and remove the need for returning multiple slices of test cases (for different combinations of experiments) which are then merged together on a per-test-server basis. As a trade-off, additional decision logic is added to testServer() and required experiments have to be specified on each individual case (as opposed to a block of cases as before). For golang/go#39663. Change-Id: Iccdce5ddd7705e1ef8acd8aa4673d4b6a1193b2e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/243017 Reviewed-by: Julie Qiu <firstname.lastname@example.org>