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

Side by Side Diff: golden/go/goldingester/goldingester_test.go

Issue 1409103004: Extend Trybot list view (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « golden/go/goldingester/goldingester.go ('k') | golden/go/goldingester/testdata/dm.json » ('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 goldingester 1 package goldingester
2 2
3 import ( 3 import (
4 "encoding/json" 4 "encoding/json"
5 "io/ioutil" 5 "io/ioutil"
6 "testing" 6 "testing"
7 7
8 metrics "github.com/rcrowley/go-metrics" 8 metrics "github.com/rcrowley/go-metrics"
9 assert "github.com/stretchr/testify/require" 9 assert "github.com/stretchr/testify/require"
10 "go.skia.org/infra/go/tiling" 10 "go.skia.org/infra/go/tiling"
(...skipping 22 matching lines...) Expand all
33 if got, want := dm.Results[0].Digest, "445aa63b2200baaba9b37fd5f80c0447" ; got != want { 33 if got, want := dm.Results[0].Digest, "445aa63b2200baaba9b37fd5f80c0447" ; got != want {
34 t.Errorf("Digest wrong: Got %v Want %v", got, want) 34 t.Errorf("Digest wrong: Got %v Want %v", got, want)
35 } 35 }
36 id, params := dm.idAndParams(dm.Results[0]) 36 id, params := dm.idAndParams(dm.Results[0])
37 if got, want := id, "x86_64:565:Debug:HD7770:ShuttleA:varied_text_clippe d_no_lcd:Win8"; got != want { 37 if got, want := id, "x86_64:565:Debug:HD7770:ShuttleA:varied_text_clippe d_no_lcd:Win8"; got != want {
38 t.Errorf("Key generation wrong: Got %v Want %v", got, want) 38 t.Errorf("Key generation wrong: Got %v Want %v", got, want)
39 } 39 }
40 if got, want := len(params), 9; got != want { 40 if got, want := len(params), 9; got != want {
41 t.Errorf("Params wrong size: Got %v Want %v", got, want) 41 t.Errorf("Params wrong size: Got %v Want %v", got, want)
42 } 42 }
43
44 assert.Equal(t, int64(12345), dm.Patchset)
43 } 45 }
44 46
45 func TestParsing(t *testing.T) { 47 func TestParsing(t *testing.T) {
46 tile := tiling.NewTile() 48 tile := tiling.NewTile()
47 offset := 1 49 offset := 1
48 dm := loadDMResults(t) 50 dm := loadDMResults(t)
49 51
50 metricsProcessed := metrics.NewRegisteredCounter("testing.ingestion.proc essed", metrics.DefaultRegistry) 52 metricsProcessed := metrics.NewRegisteredCounter("testing.ingestion.proc essed", metrics.DefaultRegistry)
51 addResultToTile(dm, tile, offset, metricsProcessed) 53 addResultToTile(dm, tile, offset, metricsProcessed)
52 if got, want := len(tile.Traces), 2; got != want { 54 if got, want := len(tile.Traces), 2; got != want {
53 t.Errorf("Wrong number of Traces: Got %v Want %v", got, want) 55 t.Errorf("Wrong number of Traces: Got %v Want %v", got, want)
54 } 56 }
55 tr := tile.Traces["x86_64:565:Debug:HD7770:ShuttleA:varied_text_clipped_ no_lcd:Win8"].(*types.GoldenTrace) 57 tr := tile.Traces["x86_64:565:Debug:HD7770:ShuttleA:varied_text_clipped_ no_lcd:Win8"].(*types.GoldenTrace)
56 if got, want := tr.Values[1], "445aa63b2200baaba9b37fd5f80c0447"; got != want { 58 if got, want := tr.Values[1], "445aa63b2200baaba9b37fd5f80c0447"; got != want {
57 t.Errorf("Digest wrong: Got %v Want %v", got, want) 59 t.Errorf("Digest wrong: Got %v Want %v", got, want)
58 } 60 }
59 if got, want := len(tr.Params()), 9; got != want { 61 if got, want := len(tr.Params()), 9; got != want {
60 t.Errorf("Params wrong: Got %v Want %v", got, want) 62 t.Errorf("Params wrong: Got %v Want %v", got, want)
61 } 63 }
62 if got, want := tr.Params()["ext"], "png"; got != want { 64 if got, want := tr.Params()["ext"], "png"; got != want {
63 t.Errorf("Extension not injected:: Got %v Want %v", got, want) 65 t.Errorf("Extension not injected:: Got %v Want %v", got, want)
64 } 66 }
65 if got, want := int64(2), metricsProcessed.Count(); got != want { 67 if got, want := int64(2), metricsProcessed.Count(); got != want {
66 t.Errorf("Wrong number of points ingested: Got %v Want %v", got, want) 68 t.Errorf("Wrong number of points ingested: Got %v Want %v", got, want)
67 } 69 }
68 } 70 }
OLDNEW
« no previous file with comments | « golden/go/goldingester/goldingester.go ('k') | golden/go/goldingester/testdata/dm.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698