aboutsummaryrefslogtreecommitdiff
path: root/internal/queue/queue_test.go
diff options
context:
space:
mode:
authorAnze Kolar <me@akolar.com>2020-07-08 14:09:57 +0200
committerJonathan Amsterdam <jba@google.com>2020-07-08 16:06:55 +0000
commit7a5705bf50a5bacd2060e3bdb6fb72cd48e2393f (patch)
treeb594188f3be053d61cb921e79105d23fb7d71462 /internal/queue/queue_test.go
parent71c954f70eeee31a7c9f0700a90573895f2e327d (diff)
downloadgo-x-pkgsite-7a5705bf50a5bacd2060e3bdb6fb72cd48e2393f.tar.xz
internal/queue: refactor existing queue creators into queue.New
Add a unified function for creating new queues so that separate implementations of newQueue in cmd/frontend and cmd/worker can be removed. Since queue.New contains the necessary logic for deciding between GCP and InMemory, the two could be made unexported after updating the corresponding tests. Fixes golang/go#40097. Change-Id: Ie509ba39ef293cca3ff95f2ce12833339c0542ea Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241477 Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/queue/queue_test.go')
-rw-r--r--internal/queue/queue_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/queue/queue_test.go b/internal/queue/queue_test.go
index e1150f13..2e2a1f8c 100644
--- a/internal/queue/queue_test.go
+++ b/internal/queue/queue_test.go
@@ -52,7 +52,7 @@ func TestNewTaskRequest(t *testing.T) {
t.Fatal(err)
}
const queueID = "queueID"
- gcp := NewGCP(cfg, nil, queueID)
+ gcp := newGCP(cfg, nil, queueID)
got := gcp.newTaskRequest("mod", "v1.2.3", "suf", time.Minute)
want := &taskspb.CreateTaskRequest{
Parent: "projects/Project/locations/us-central1/queues/" + queueID,