Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/pkgsite: add testcase for stdlib shortcut in frontend.TestServer #39663

Closed
julieqiu opened this issue Jun 17, 2020 · 3 comments
Closed

x/pkgsite: add testcase for stdlib shortcut in frontend.TestServer #39663

julieqiu opened this issue Jun 17, 2020 · 3 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. pkgsite
Milestone

Comments

@julieqiu
Copy link
Member

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.

Related: #39621

@julieqiu julieqiu added NeedsFix The path to resolution is known, but the work has not been done. pkgsite labels Jun 17, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jun 17, 2020
@gopherbot
Copy link

Change https://golang.org/cl/242137 mentions this issue: internal/frontend: add tests for stdlib shortcuts

@gopherbot
Copy link

Change https://golang.org/cl/242138 mentions this issue: internal/frontend: fix redirects for shortcuts with trailing slashes

@gopherbot
Copy link

Change https://golang.org/cl/243017 mentions this issue: internal/frontend: refactor serverTestCases()

gopherbot pushed a commit to golang/pkgsite that referenced this issue Jul 23, 2020
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 <julie@golang.org>
@golang golang locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. pkgsite
Projects
None yet
Development

No branches or pull requests

2 participants