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

Side by Side Diff: perf/go/ingester/ingester_test.go

Issue 777413002: Add new tests to presubmit, fix errors (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: rebase Created 6 years 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
« no previous file with comments | « perf/go/ingester/ingester.go ('k') | perf/go/shortcut/shortcut.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package ingester 1 package ingester
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "io/ioutil" 5 "io/ioutil"
6 "os" 6 "os"
7 "path/filepath" 7 "path/filepath"
8 "runtime" 8 "runtime"
9 "testing" 9 "testing"
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 // Create a temporary place for a filetilestore. 31 // Create a temporary place for a filetilestore.
32 tileDir, err := ioutil.TempDir("", "skiaperf") 32 tileDir, err := ioutil.TempDir("", "skiaperf")
33 if err != nil { 33 if err != nil {
34 t.Fatal("Failed to create testing Tile dir: ", err) 34 t.Fatal("Failed to create testing Tile dir: ", err)
35 } 35 }
36 defer os.RemoveAll(tileDir) 36 defer os.RemoveAll(tileDir)
37 37
38 git, err := gitinfo.NewGitInfo(filepath.Join(tr.Dir, "testrepo"), false, false) 38 git, err := gitinfo.NewGitInfo(filepath.Join(tr.Dir, "testrepo"), false, false)
39 if err != nil { 39 if err != nil {
40 » » glog.Fatal("Failed loading Git info: %s\n", err) 40 » » glog.Fatalf("Failed loading Git info: %s\n", err)
41 } 41 }
42 42
43 // Construct an Ingestor and have it UpdateCommitInfo. 43 // Construct an Ingestor and have it UpdateCommitInfo.
44 i, err := NewIngester(git, tileDir, config.DATASET_NANO, NanoBenchIngest ion, "", "") 44 i, err := NewIngester(git, tileDir, config.DATASET_NANO, NanoBenchIngest ion, "", "")
45 if err != nil { 45 if err != nil {
46 t.Fatal("Failed to create ingester:", err) 46 t.Fatal("Failed to create ingester:", err)
47 } 47 }
48 48
49 if err := i.UpdateCommitInfo(false); err != nil { 49 if err := i.UpdateCommitInfo(false); err != nil {
50 t.Fatal("Failed to ingest commits:", err) 50 t.Fatal("Failed to ingest commits:", err)
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 benchData.Options["system"] = "Linux" 157 benchData.Options["system"] = "Linux"
158 addBenchDataToTile(benchData, tile, offset, metricsProcessed) 158 addBenchDataToTile(benchData, tile, offset, metricsProcessed)
159 if got, want := "Linux", tile.Traces[key].Params()["system"]; got != wan t { 159 if got, want := "Linux", tile.Traces[key].Params()["system"]; got != wan t {
160 t.Errorf("Failed to update params: Got %v Want %v", got, want) 160 t.Errorf("Failed to update params: Got %v Want %v", got, want)
161 } 161 }
162 if got, want := int64(27), metricsProcessed.Count(); got != want { 162 if got, want := int64(27), metricsProcessed.Count(); got != want {
163 t.Errorf("Wrong number of points ingested: Got %v Want %v", got, want) 163 t.Errorf("Wrong number of points ingested: Got %v Want %v", got, want)
164 } 164 }
165 } 165 }
OLDNEW
« no previous file with comments | « perf/go/ingester/ingester.go ('k') | perf/go/shortcut/shortcut.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698