diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-03-12 13:43:38 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-03-17 18:06:44 +0100 |
| commit | ded8ff151d66a79c087cd3853365d913d35c623a (patch) | |
| tree | fbdeb748da77de2e8a131ea60266e3969571c7e9 /dashboard/app/util_test.go | |
| parent | d7e03eccccd1b19d0eb3e1aea43d871c2bed366d (diff) | |
dashboard/app: load crash in loadJob test helper
Will be useful for bisection testing.
Update #501
Diffstat (limited to 'dashboard/app/util_test.go')
| -rw-r--r-- | dashboard/app/util_test.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/dashboard/app/util_test.go b/dashboard/app/util_test.go index 2f9d959c3..b9abd34fa 100644 --- a/dashboard/app/util_test.go +++ b/dashboard/app/util_test.go @@ -213,7 +213,7 @@ func (c *Ctx) loadBug(extID string) (*Bug, *Crash, *Build) { return bug, crash, build } -func (c *Ctx) loadJob(extID string) (*Job, *Build) { +func (c *Ctx) loadJob(extID string) (*Job, *Build, *Crash) { jobKey, err := jobID2Key(c.ctx, extID) if err != nil { c.t.Fatalf("failed to create job key: %v", err) @@ -226,7 +226,12 @@ func (c *Ctx) loadJob(extID string) (*Job, *Build) { if err != nil { c.t.Fatalf("failed to load build: %v", err) } - return job, build + crash := new(Crash) + crashKey := datastore.NewKey(c.ctx, "Crash", "", job.CrashID, jobKey.Parent()) + if err := datastore.Get(c.ctx, crashKey, crash); err != nil { + c.t.Fatalf("failed to load crash for job: %v", err) + } + return job, build, crash } func (c *Ctx) checkURLContents(url string, want []byte) { |
