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

Side by Side Diff: task_scheduler/go/scheduling/task_scheduler_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 "encoding/json" 4 "encoding/json"
5 "fmt" 5 "fmt"
6 "io/ioutil" 6 "io/ioutil"
7 "math" 7 "math"
8 "os" 8 "os"
9 "path" 9 "path"
10 "path/filepath" 10 "path/filepath"
11 "runtime" 11 "runtime"
12 "sort" 12 "sort"
13 "strings" 13 "strings"
14 "testing" 14 "testing"
15 "time" 15 "time"
16 16
17 swarming_api "github.com/luci/luci-go/common/api/swarming/swarming/v1" 17 swarming_api "github.com/luci/luci-go/common/api/swarming/swarming/v1"
18 assert "github.com/stretchr/testify/require" 18 assert "github.com/stretchr/testify/require"
19 "go.skia.org/infra/build_scheduler/go/db"
20 "go.skia.org/infra/go/buildbot" 19 "go.skia.org/infra/go/buildbot"
21 "go.skia.org/infra/go/exec" 20 "go.skia.org/infra/go/exec"
22 "go.skia.org/infra/go/gitinfo" 21 "go.skia.org/infra/go/gitinfo"
23 "go.skia.org/infra/go/gitrepo" 22 "go.skia.org/infra/go/gitrepo"
24 "go.skia.org/infra/go/isolate" 23 "go.skia.org/infra/go/isolate"
25 "go.skia.org/infra/go/swarming" 24 "go.skia.org/infra/go/swarming"
26 "go.skia.org/infra/go/testutils" 25 "go.skia.org/infra/go/testutils"
27 "go.skia.org/infra/go/util" 26 "go.skia.org/infra/go/util"
27 "go.skia.org/infra/task_scheduler/go/db"
28 ) 28 )
29 29
30 func makeTask(name, repo, revision string) *db.Task { 30 func makeTask(name, repo, revision string) *db.Task {
31 return &db.Task{ 31 return &db.Task{
32 Commits: []string{revision}, 32 Commits: []string{revision},
33 Created: time.Now(), 33 Created: time.Now(),
34 Name: name, 34 Name: name,
35 Repo: repo, 35 Repo: repo,
36 Revision: revision, 36 Revision: revision,
37 } 37 }
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 assert.NoError(t, s.MainLoop()) 1384 assert.NoError(t, s.MainLoop())
1385 assert.Equal(t, 0, len(s.queue)) 1385 assert.Equal(t, 0, len(s.queue))
1386 tasks, err = cache.GetTasksForCommits(repoName, commits) 1386 tasks, err = cache.GetTasksForCommits(repoName, commits)
1387 assert.NoError(t, err) 1387 assert.NoError(t, err)
1388 for _, byName := range tasks { 1388 for _, byName := range tasks {
1389 for _, task := range byName { 1389 for _, task := range byName {
1390 assert.Equal(t, 1, len(task.Commits)) 1390 assert.Equal(t, 1, len(task.Commits))
1391 } 1391 }
1392 } 1392 }
1393 } 1393 }
OLDNEW
« no previous file with comments | « task_scheduler/go/scheduling/task_scheduler.go ('k') | task_scheduler/go/scheduling/testdata/testrepo.zip » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698