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

Side by Side Diff: task_scheduler/go/scheduling/task_candidate_test.go

Issue 2296763008: [task scheduler] Move files from build_scheduler/ to task_scheduler/ (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Created 4 years, 3 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 package task_scheduler 1 package scheduling
2 2
3 import ( 3 import (
4 "testing" 4 "testing"
5 5
6 "github.com/stretchr/testify/assert" 6 "github.com/stretchr/testify/assert"
7 ) 7 )
8 8
9 func TestTaskCandidateId(t *testing.T) { 9 func TestTaskCandidateId(t *testing.T) {
10 t1 := makeTaskCandidate("task1", []string{"k:v"}) 10 t1 := makeTaskCandidate("task1", []string{"k:v"})
11 t1.Repo = "Myrepo" 11 t1.Repo = "Myrepo"
12 t1.Revision = "abc123" 12 t1.Revision = "abc123"
13 id1 := t1.MakeId() 13 id1 := t1.MakeId()
14 repo1, name1, rev1, err := parseId(id1) 14 repo1, name1, rev1, err := parseId(id1)
15 assert.NoError(t, err) 15 assert.NoError(t, err)
16 assert.Equal(t, t1.Repo, repo1) 16 assert.Equal(t, t1.Repo, repo1)
17 assert.Equal(t, t1.Name, name1) 17 assert.Equal(t, t1.Name, name1)
18 assert.Equal(t, t1.Revision, rev1) 18 assert.Equal(t, t1.Revision, rev1)
19 19
20 badIds := []string{ 20 badIds := []string{
21 "", 21 "",
22 "taskCandidate|a|b|", 22 "taskCandidate|a|b|",
23 "20160831T000018.497703717Z_000000000000015b", 23 "20160831T000018.497703717Z_000000000000015b",
24 } 24 }
25 for _, id := range badIds { 25 for _, id := range badIds {
26 _, _, _, err := parseId(id) 26 _, _, _, err := parseId(id)
27 assert.Error(t, err) 27 assert.Error(t, err)
28 } 28 }
29 } 29 }
OLDNEW
« no previous file with comments | « task_scheduler/go/scheduling/task_candidate.go ('k') | task_scheduler/go/scheduling/task_scheduler.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698