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

Unified Diff: appengine/cmd/milo/swarming/build.go

Issue 2150933004: milo: dedup testdata (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/cmd/milo/frontend/testdata/buildbucket ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/cmd/milo/swarming/build.go
diff --git a/appengine/cmd/milo/swarming/build.go b/appengine/cmd/milo/swarming/build.go
index e8ff5973baf8354a52892f531622dd87972d9761..01d2fa51cf37c10c5f8062aa5f662d2834de63d5 100644
--- a/appengine/cmd/milo/swarming/build.go
+++ b/appengine/cmd/milo/swarming/build.go
@@ -60,7 +60,11 @@ func getSwarmingClient(c context.Context, server string) (*swarming.Service, err
func getDebugTaskOutput(taskID string) (string, error) {
// Read the debug file instead.
- logFilename := filepath.Join("testdata", taskID)
+
+ // ../swarming below assumes that
+ // - this code is not executed by tests outside of this dir
+ // - this dir is a sibling of frontend dir
+ logFilename := filepath.Join("..", "swarming", "testdata", taskID)
b, err := ioutil.ReadFile(logFilename)
if err != nil {
return "", err
@@ -79,7 +83,10 @@ func getTaskOutput(sc *swarming.Service, taskID string) (string, error) {
func getDebugSwarmingResult(
taskID string) (*swarming.SwarmingRpcsTaskResult, error) {
- logFilename := filepath.Join("testdata", taskID)
+ // ../swarming below assumes that
+ // - this code is not executed by tests outside of this dir
+ // - this dir is a sibling of frontend dir
+ logFilename := filepath.Join("..", "swarming", "testdata", taskID)
swarmFilename := fmt.Sprintf("%s.swarm", logFilename)
s, err := ioutil.ReadFile(swarmFilename)
if err != nil {
« no previous file with comments | « appengine/cmd/milo/frontend/testdata/buildbucket ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698