From ded8ff151d66a79c087cd3853365d913d35c623a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 12 Mar 2019 13:43:38 +0100 Subject: dashboard/app: load crash in loadJob test helper Will be useful for bisection testing. Update #501 --- dashboard/app/util_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'dashboard/app/util_test.go') 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) { -- cgit mrf-deployment