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

Unified Diff: scheduler/appengine/engine/engine_test.go

Issue 2993793003: [scheduler]: ACLs phase 3 - require ACLs specs for each Job/Trigger. (Closed)
Patch Set: Updated patchset dependency Created 3 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scheduler/appengine/acl/acl_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scheduler/appengine/engine/engine_test.go
diff --git a/scheduler/appengine/engine/engine_test.go b/scheduler/appengine/engine/engine_test.go
index 41b554a58adf2eaba0ef1c2b4c6d96f90a90bdde..5e333ebb2557efe6488e964952544b9f30d3dfcc 100644
--- a/scheduler/appengine/engine/engine_test.go
+++ b/scheduler/appengine/engine/engine_test.go
@@ -84,29 +84,6 @@ func TestUpdateProjectJobs(t *testing.T) {
So(allJobs(c), ShouldResemble, []Job{})
// Adding a new job (ticks every 5 sec).
- So(e.UpdateProjectJobs(c, "abc", []catalog.Definition{
- {
- JobID: "abc/1",
- Revision: "rev1",
- Schedule: "*/5 * * * * * *",
- }}), ShouldBeNil)
- So(allJobs(c), ShouldResemble, []Job{
- {
- JobID: "abc/1",
- ProjectID: "abc",
- Revision: "rev1",
- Enabled: true,
- Schedule: "*/5 * * * * * *",
- State: JobState{
- State: "SCHEDULED",
- TickNonce: 6278013164014963328,
- TickTime: epoch.Add(5 * time.Second),
- },
- },
- })
-
- // TODO(tandrii): delete and update above definition after no-ACL -> ACL transition.
- // Simulate ACL version roll without change of project config.
So(e.UpdateProjectJobs(c, "abc", []catalog.Definition{
{
JobID: "abc/1",
@@ -572,14 +549,14 @@ func TestQueries(t *testing.T) {
Convey("with mock data", t, func() {
c := newTestContext(epoch)
e, _ := newTestEngine()
- // TODO(tandrii): remove aclDefault once all Jobs have ACLs.
- aclDefault := acl.GrantsByRole{}
+ aclPublic := acl.GrantsByRole{Readers: []string{"group:all"}, Owners: []string{"group:administrators"}}
aclSome := acl.GrantsByRole{Readers: []string{"group:some"}}
aclOne := acl.GrantsByRole{Owners: []string{"one@example.com"}}
aclAdmin := acl.GrantsByRole{Readers: []string{"group:administrators"}, Owners: []string{"group:administrators"}}
ctxAnon := auth.WithState(c, &authtest.FakeState{
- Identity: "anonymous:anonymous",
+ Identity: "anonymous:anonymous",
+ IdentityGroups: []string{"all"},
})
ctxOne := auth.WithState(c, &authtest.FakeState{
Identity: "user:one@example.com",
@@ -587,19 +564,19 @@ func TestQueries(t *testing.T) {
})
ctxSome := auth.WithState(c, &authtest.FakeState{
Identity: "user:some@example.com",
- IdentityGroups: []string{"some"},
+ IdentityGroups: []string{"all", "some"},
})
ctxAdmin := auth.WithState(c, &authtest.FakeState{
Identity: "user:admin@example.com",
- IdentityGroups: []string{"administrators"},
+ IdentityGroups: []string{"administrators", "all"},
})
So(ds.Put(c,
&Job{JobID: "abc/1", ProjectID: "abc", Enabled: true, Acls: aclOne},
&Job{JobID: "abc/2", ProjectID: "abc", Enabled: true, Acls: aclSome},
- &Job{JobID: "abc/3", ProjectID: "abc", Enabled: true, Acls: aclDefault},
- &Job{JobID: "def/1", ProjectID: "def", Enabled: true, Acls: aclDefault},
- &Job{JobID: "def/2", ProjectID: "def", Enabled: false, Acls: aclDefault},
+ &Job{JobID: "abc/3", ProjectID: "abc", Enabled: true, Acls: aclPublic},
+ &Job{JobID: "def/1", ProjectID: "def", Enabled: true, Acls: aclPublic},
+ &Job{JobID: "def/2", ProjectID: "def", Enabled: false, Acls: aclPublic},
&Job{JobID: "secret/1", ProjectID: "secret", Enabled: true, Acls: aclAdmin},
), ShouldBeNil)
« no previous file with comments | « scheduler/appengine/acl/acl_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698