Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: tokenserver/appengine/impl/delegation/config_test.go

Issue 2779323002: token-server: Warmup some local caches in /_ah/warmup. (Closed)
Patch Set: also warmup delegation config Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package delegation 5 package delegation
6 6
7 import ( 7 import (
8 "testing" 8 "testing"
9 "time" 9 "time"
10 10
(...skipping 11 matching lines...) Expand all
22 22
23 . "github.com/luci/luci-go/common/testing/assertions" 23 . "github.com/luci/luci-go/common/testing/assertions"
24 . "github.com/smartystreets/goconvey/convey" 24 . "github.com/smartystreets/goconvey/convey"
25 ) 25 )
26 26
27 func TestDelegationConfigLoader(t *testing.T) { 27 func TestDelegationConfigLoader(t *testing.T) {
28 Convey("DelegationConfigLoader works", t, func() { 28 Convey("DelegationConfigLoader works", t, func() {
29 ctx := gaetesting.TestingContext() 29 ctx := gaetesting.TestingContext()
30 ctx, tc := testclock.UseTime(ctx, testclock.TestTimeUTC) 30 ctx, tc := testclock.UseTime(ctx, testclock.TestTimeUTC)
31 31
32 » » loader := DelegationConfigLoader() 32 » » loader := delegationConfigLoader()
33 33
34 // Put the initial copy into the datastore. 34 // Put the initial copy into the datastore.
35 cfg, err := loadConfig(` 35 cfg, err := loadConfig(`
36 rules { 36 rules {
37 name: "rule 1" 37 name: "rule 1"
38 requestor: "user:some-user@example.com" 38 requestor: "user:some-user@example.com"
39 target_service: "service:some-service" 39 target_service: "service:some-service"
40 allowed_to_impersonate: "group:some-group" 40 allowed_to_impersonate: "group:some-group"
41 allowed_audience: "REQUESTOR" 41 allowed_audience: "REQUESTOR"
42 max_validity_duration: 86400 42 max_validity_duration: 86400
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 return c, nil 332 return c, nil
333 } 333 }
334 334
335 func makeSet(ident ...string) *identityset.Set { 335 func makeSet(ident ...string) *identityset.Set {
336 s, err := identityset.FromStrings(ident, nil) 336 s, err := identityset.FromStrings(ident, nil)
337 if err != nil { 337 if err != nil {
338 panic(err) 338 panic(err)
339 } 339 }
340 return s 340 return s
341 } 341 }
OLDNEW
« no previous file with comments | « tokenserver/appengine/impl/delegation/config.go ('k') | tokenserver/appengine/impl/delegation/warmup.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698