aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module_test.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2021-04-07 19:59:52 -0400
committerJonathan Amsterdam <jba@google.com>2021-04-08 16:30:25 +0000
commitd189d9d19b2d6ec3358cc44d98c6354682aee052 (patch)
tree4f8c04345729758b2de4be69f0643382a21ecccd /internal/postgres/insert_module_test.go
parentd5da038b60d9e6ee245c4cd69adad526aeb7d9b3 (diff)
downloadgo-x-pkgsite-d189d9d19b2d6ec3358cc44d98c6354682aee052.tar.xz
internal/postgres: continue MustInsertModule cleanup
Remove calls to MustInsertModuleLMV. It helped to reorganize TestGetLatestUnitVersion to be clearer about the go.mod contents of the various module versions. Change-Id: I7fa41bd742cf8bba2b5274172ad5b79fc22e73a9 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/308270 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
Diffstat (limited to 'internal/postgres/insert_module_test.go')
-rw-r--r--internal/postgres/insert_module_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/postgres/insert_module_test.go b/internal/postgres/insert_module_test.go
index 66ec5c1d..ad6b3492 100644
--- a/internal/postgres/insert_module_test.go
+++ b/internal/postgres/insert_module_test.go
@@ -663,13 +663,15 @@ func TestReInsertLatestVersion(t *testing.T) {
insert := func(version string, status int, imports []string, modfile string) {
m := sample.Module(modulePath, version, "pkg")
- lmv := addLatest(ctx, t, testDB, modulePath, version, "module "+modulePath+"\n"+modfile)
pkg := m.Packages()[0]
pkg.Documentation[0].Synopsis = version
pkg.Imports = imports
if status == 200 {
- MustInsertModuleLMV(ctx, t, testDB, m, lmv)
+ MustInsertModuleGoMod(ctx, t, testDB, m, modfile)
+ } else {
+ addLatest(ctx, t, testDB, modulePath, version, modfile)
}
+
if err := testDB.UpsertModuleVersionState(ctx, &ModuleVersionStateForUpsert{
ModulePath: modulePath,
Version: version,