internal/frontend/fetchserver: add test for "synctest" shortcut
The previous commit 5cd44362491235c04771c4d8dfcacdd265ada373 added tests
that internal packages are not found by a shortcut. This change adds a
test that a package (like synctest) which has an internal and public
package is found.
Updates golang/go#76136
diff --git a/internal/frontend/fetchserver/server_test.go b/internal/frontend/fetchserver/server_test.go
index 23d31bc..b62c02a 100644
--- a/internal/frontend/fetchserver/server_test.go
+++ b/internal/frontend/fetchserver/server_test.go
@@ -169,6 +169,14 @@
name: "asan",
suffix: "internal/asan",
},
+ {
+ name: "synctest",
+ suffix: "internal/synctest",
+ },
+ {
+ name: "synctest",
+ suffix: "testing/synctest",
+ },
},
},
{
@@ -683,6 +691,12 @@
wantLocation: "/net/http",
},
{
+ name: "stdlib shortcut (testing/synctest) with internal package (internal/synctest)",
+ urlPath: "/synctest",
+ wantStatusCode: http.StatusFound,
+ wantLocation: "/testing/synctest",
+ },
+ {
name: "stdlib shortcut with trailing slash",
urlPath: "/http/",
wantStatusCode: http.StatusMovedPermanently,
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Congratulations on opening your first change. Thank you for your contribution!
Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.
Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
versions: []string{"v1.13.0"},The synctest package did not exist at this point but I don't think this test data has to match the actual stdlib?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
versions: []string{"v1.13.0"},The synctest package did not exist at this point but I don't think this test data has to match the actual stdlib?
Indeed, this is just fake data used solely in tests.
I'll trigger our tests, and it should show that everything works fine.
name: "stdlib shortcut (testing/synctest) with internal package (internal/synctest)",Thanks for the change!
LGTM. If you'd allow me to be a bit nitpicky here though, I think putting this particular test case just below the other internal ones would be nice :-)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
name: "stdlib shortcut (testing/synctest) with internal package (internal/synctest)",Thanks for the change!
LGTM. If you'd allow me to be a bit nitpicky here though, I think putting this particular test case just below the other internal ones would be nice :-)
Moved the test. The two test above the old location were doing shortcut tests so I thought that would be a fine place.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/2dbcdb2c-2abc-4fa6-9c2a-d774d55d13ea
| kokoro-CI | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Kokoro presubmit build finished with status: FAILURE
Logs at: https://source.cloud.google.com/results/invocations/f6593093-f7c4-45db-ba04-896651e249cf
| kokoro-CI | -1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Hmm, Kokoro is unexpectedly failing.
Seems to be an unrelated error and likely to be a flake from a quick read though.
Revoting to retrigger Kokoro.
Removed kokoro-CI-1 by kokoro <noreply...@google.com>
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Hmm, Kokoro is unexpectedly failing.
Seems to be an unrelated error and likely to be a flake from a quick read though.Revoting to retrigger Kokoro.
Still didn't trigger :-(
Let's try again after removing the `kokoro-CI-1` vote and the Kokoro reviewer.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| TryBot-Bypass | +1 |
Nicholas HusinHmm, Kokoro is unexpectedly failing.
Seems to be an unrelated error and likely to be a flake from a quick read though.Revoting to retrigger Kokoro.
Still didn't trigger :-(
Let's try again after removing the `kokoro-CI-1` vote and the Kokoro reviewer.
Ouch, I guess triggering a new Kokoro run requires uploading a new Patchset (i.e. the uploader can run `git commit --amend --date=now --no-edit` and re-upload the CL).
Given that Kokoro had a passing build with the same content from earlier though (http://sponge2.corp.google.com/2dbcdb2c-2abc-4fa6-9c2a-d774d55d13ea), it seems fair to bypass this rather than unduly burdening the uploader.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
internal/frontend/fetchserver: add test for "synctest" shortcut
The previous commit 5cd44362491235c04771c4d8dfcacdd265ada373 added tests
that internal packages are not found by a shortcut. This change adds a
test that a package (like synctest) which has an internal and public
package is found.
Updates golang/go#76136
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |