[pkgsite] internal/tests/api: fix deprecation test, simplify

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Apr 29, 2026, 4:20:40 PM (21 hours ago) Apr 29
to Jonathan Amsterdam, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, kokoro, golang...@luci-project-accounts.iam.gserviceaccount.com, Hyang-Ah Hana Kim, Ethan Lee, golang-co...@googlegroups.com

Gopher Robot submitted the change with unreviewed changes

Unreviewed changes

5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: internal/tests/api/api_test.go
Insertions: 3, Deletions: 0.

@@ -106,6 +106,8 @@
})
}

+// TODO(jba): add to the set of modules until all tests pass.
+// Then call once at the top of TestAPI.
func insertModules(t *testing.T, ds internal.TestingDataSource) {
const (
pkgPath = "example.com/a/b"
@@ -233,6 +235,7 @@

func testServePackage(t *testing.T, ds internal.TestingDataSource) {
insertModules(t, ds)
+ // TODO(jba): call insertModules in other tests.

for _, test := range []struct {
name string
```

Change information

Commit message:
internal/tests/api: fix deprecation test, simplify

Fix the test that shows that we ignore deprecated modules.
Previously, this test always used the fake data source, even for the
DB. In fixing it, we discovered that the DB needs a go.mod file to
determine deprecation.

We discovered this while cleaning up tests, moving module insertion
to a separate function. This change is still here because it would
be challenging to split the two at this point.
Change-Id: I91be5d728d9c7dd827341f6c3ac56839c234f39a
Reviewed-by: Hyang-Ah Hana Kim <hya...@gmail.com>
Auto-Submit: Jonathan Amsterdam <j...@google.com>
kokoro-CI: kokoro <noreply...@google.com>
Files:
  • M internal/datasource.go
  • M internal/postgres/test_helper.go
  • M internal/testing/fakedatasource/fakedatasource.go
  • M internal/testing/sample/sample.go
  • M internal/tests/api/api_test.go
Change size: L
Delta: 5 files changed, 136 insertions(+), 138 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: pkgsite
Gerrit-Branch: master
Gerrit-Change-Id: I91be5d728d9c7dd827341f6c3ac56839c234f39a
Gerrit-Change-Number: 771380
Gerrit-PatchSet: 7
Gerrit-Owner: Jonathan Amsterdam <j...@google.com>
Gerrit-Reviewer: Ethan Lee <etha...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
Gerrit-Reviewer: Jonathan Amsterdam <j...@google.com>
Gerrit-Reviewer: kokoro <noreply...@google.com>
Gerrit-CC: kokoro <noreply...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages