aboutsummaryrefslogtreecommitdiff
path: root/internal/queue/queue_test.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2020-12-16 11:29:14 -0500
committerJonathan Amsterdam <jba@google.com>2020-12-21 18:22:28 +0000
commit337d847dbf5fed82d0358040c75a4ea1f9572a4b (patch)
treed93aa78a5e6292ca10c28ce672051e127241f48a /internal/queue/queue_test.go
parent119183b4e9c74b8237d4f7be93df0ee748e2dad5 (diff)
downloadgo-x-pkgsite-337d847dbf5fed82d0358040c75a4ea1f9572a4b.tar.xz
internal/queue,frontend,worker: enqueue tasks disabling proxy fetch
If the status of a task to be enqueued indicates reprocessing, then enqueue the task with a URL whose query param indicates that proxy fetching should be disabled. Change-Id: Id7255e861c1dea87d131d83151eb1a46df0ea4ff Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/278712 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>
Diffstat (limited to 'internal/queue/queue_test.go')
-rw-r--r--internal/queue/queue_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/queue/queue_test.go b/internal/queue/queue_test.go
index b4afd2fc..54a6e153 100644
--- a/internal/queue/queue_test.go
+++ b/internal/queue/queue_test.go
@@ -60,9 +60,17 @@ func TestNewTaskRequest(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- got := gcp.newTaskRequest("mod", "v1.2.3", "suf")
+ got := gcp.newTaskRequest("mod", "v1.2.3", "suf", false)
want.Task.Name = got.Task.Name
if diff := cmp.Diff(want, got, cmp.Comparer(proto.Equal)); diff != "" {
t.Errorf("mismatch (-want, +got):\n%s", diff)
}
+
+ want.Task.MessageType.(*taskspb.Task_HttpRequest).HttpRequest.Url += "?proxyfetch=off"
+ got = gcp.newTaskRequest("mod", "v1.2.3", "suf", true)
+ want.Task.Name = got.Task.Name
+ if diff := cmp.Diff(want, got, cmp.Comparer(proto.Equal)); diff != "" {
+ t.Errorf("mismatch (-want, +got):\n%s", diff)
+ }
+
}