Skip to content
Permalink
Browse files

Refactor and unify test outputs (#467)

* feat(plans/dht): log network connect and disconnect events

* feat: log query events

* runtime/runenv: extract logging to embedded struct; simplify.

* add .dockerignore.

* runtime/runenv: add Record* methods; adjust logger params.

* runtime/runenv: log an Event.

* refactor pretty printer (previously event manager + logger); more.

* Record start event.
* Ensure structured log output is properly parseable.
* `local:docker` now logs into a runner subdirectory.

* refactor and inject outputs path dir in runners.

* local:docker: remove env.json dump.

* runtime/runner: tee stderr to run.err + remove sidecar log writing.

* sidecar: remove logging options.

* pretty: add OTHER event type, for debugging and unstructured leaks.

* runtime/runenv: fix logging setup for non-testplan cases.

* runtime/files: methods for creating raw and structured assets.

* dht: trace DHT and connection events.

* fix test.

* runenv: sync/close output assets.

* feat/collect cmd (#463)

* wip: boilerplate collect outputs

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

* wip: boilerplate zip output

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

* wip: test if it works w/ example

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

* feat: log error

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

* fix: just panic for now

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

* fix: rebase issues

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>

* wip

* collect: implement for local:exec and local:docker.

* cmd/run: print run ID on client side.

* use /outputs value

* remove bucket name from archive

* refactor CollectOutputs

* fix network plan

* remove return code. extract downloader

* local:docker: return runid

Co-authored-by: Henrique Dias <hacdias@gmail.com>
Co-authored-by: Raúl Kripalani <raul.kripalani@gmail.com>

* go mod tidy

* s3 download pagination

Co-authored-by: Steven Allen <steven@stebalien.com>
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
Co-authored-by: Henrique Dias <hacdias@gmail.com>
  • Loading branch information
4 people committed Feb 5, 2020
1 parent e3f72fb commit fd3688851231f283a6a1e5ac33974b516e91bb8e
Showing with 1,370 additions and 775 deletions.
  1. +8 −0 .dockerignore
  2. +1 −0 cmd/all.go
  3. +90 −0 cmd/collect.go
  4. +20 −14 cmd/run.go
  5. +1 −6 cmd/sidecar.go
  6. +7 −7 compositions/find-peers.example.toml
  7. +8 −1 go.mod
  8. +22 −2 go.sum
  9. +1 −0 pkg/api/engine.go
  10. +13 −2 pkg/api/runner.go
  11. +19 −4 pkg/client/client.go
  12. +7 −0 pkg/client/types.go
  13. +2 −2 pkg/conv/conversions.go
  14. +1 −0 pkg/daemon/daemon.go
  15. +33 −0 pkg/daemon/outputs.go
  16. +15 −0 pkg/engine/engine.go
  17. +82 −11 pkg/runner/cluster_k8s.go
  18. +12 −10 pkg/runner/cluster_swarm.go
  19. +80 −5 pkg/runner/common.go
  20. +7 −1 pkg/runner/common_test.go
  21. +0 −62 pkg/runner/console.go
  22. +0 −207 pkg/runner/eventmanager.go
  23. +0 −58 pkg/runner/filelogger.go
  24. +37 −49 pkg/runner/local_docker.go
  25. +44 −19 pkg/runner/local_exec.go
  26. +222 −0 pkg/runner/pretty.go
  27. +13 −12 pkg/sidecar/docker_instance.go
  28. +0 −55 pkg/sidecar/docker_logs.go
  29. +2 −5 pkg/sidecar/instance.go
  30. +1 −10 pkg/sidecar/k8s_instance.go
  31. +1 −1 pkg/sidecar/other.go
  32. +6 −37 pkg/sidecar/sidecar.go
  33. +3 −1 plans/bitswap-tuning/test/transfer.go
  34. +1 −0 plans/dht/go.mod
  35. +1 −0 plans/dht/main.go
  36. +1 −1 plans/dht/test/common.go
  37. +6 −1 plans/dht/test/find_peers.go
  38. +78 −0 plans/dht/test/tracers.go
  39. +1 −1 plans/network/main.go
  40. +12 −1 plans/smlbench/go.mod
  41. +60 −0 plans/smlbench/go.sum
  42. +56 −6 sdk/runtime/files.go
  43. +73 −0 sdk/runtime/logger.go
  44. +160 −41 sdk/runtime/output.go
  45. +89 −126 sdk/runtime/runenv.go
  46. +43 −10 sdk/runtime/runner.go
  47. +31 −7 sdk/sync/redis_test.go
@@ -0,0 +1,8 @@
**/.dockerignore
**/.DS_Store
**/.git/
**/.gitattributes
**/.gitignore
**/.gitkeep
**/.gitmodules
**/Dockerfile
@@ -20,6 +20,7 @@ var Commands = []cli.Command{
DescribeCommand,
SidecarCommand,
DaemonCommand,
CollectCommand,
}

var Flags = []cli.Flag{
@@ -0,0 +1,90 @@
package cmd

import (
"context"
"errors"
"fmt"
"io"
"os"

"github.com/ipfs/testground/pkg/client"
"github.com/ipfs/testground/pkg/logging"

"github.com/urfave/cli"
)

// CollectCommand is the specification of the `collect` command.
var CollectCommand = cli.Command{
Name: "collect",
Usage: "Produces a zip file with the output from a certain run",
Action: collectCommand,
ArgsUsage: "[run_id]",
Flags: []cli.Flag{
cli.StringFlag{
Name: "runner, r",
Usage: "specifies the runner to use; values include: 'local:exec', 'local:docker', 'cluster:k8s'",
Required: true,
},
cli.StringFlag{
Name: "output, o",
Usage: "specifies a named output for the zip file",
},
},
}

func collectCommand(c *cli.Context) error {
ctx, cancel := context.WithCancel(ProcessContext())
defer cancel()

if c.NArg() != 1 {
_ = cli.ShowSubcommandHelp(c)
return errors.New("missing run id")
}

var (
id = c.Args().First()
runner = c.String("runner")
output = id + ".zip"
)

if o := c.String("output"); o != "" {
output = o
}

api, err := setupClient(c)
if err != nil {
return err
}

req := &client.OutputsRequest{
Runner: runner,
RunID: id,
}

resp, err := api.CollectOutputs(ctx, req)
if err != nil {
if err == context.Canceled {
return fmt.Errorf("interrupted")
}
return fmt.Errorf("fatal error from daemon: %s", err)
}
defer resp.Close()

file, err := os.Create(output)
if err != nil {
if err == context.Canceled {
return fmt.Errorf("interrupted")
}
return fmt.Errorf("fatal error from daemon: %s", err)
}
defer file.Close()

_, err = io.Copy(file, resp)
if err != nil {
return err
}

logging.S().Infof("created file: %s", output)

return nil
}
@@ -5,9 +5,10 @@ import (
"fmt"
"os"

"github.com/ipfs/testground/pkg/logging"

"github.com/ipfs/testground/pkg/api"
"github.com/ipfs/testground/pkg/client"
"github.com/ipfs/testground/pkg/logging"

"github.com/BurntSushi/toml"
"github.com/urfave/cli"
@@ -91,17 +92,6 @@ func runCompositionCmd(c *cli.Context) (err error) {
return err
}

if c.Bool("write-artifacts") {
f, err := os.OpenFile(file, os.O_WRONLY, 0644)
if err != nil {
return fmt.Errorf("failed to write composition to file: %w", err)
}
enc := toml.NewEncoder(f)
if err := enc.Encode(comp); err != nil {
return fmt.Errorf("failed to encode composition into file: %w", err)
}
}

return nil
}

@@ -146,9 +136,19 @@ func doRun(c *cli.Context, comp *api.Composition) (err error) {
// Populate the returned build IDs.
for i, groupIdx := range buildIdx {
g := &comp.Groups[groupIdx]
logging.S().Infow("generated build artifact", "group", g.ID, "artifact", bout[i].ArtifactPath)
g.Run.Artifact = bout[i].ArtifactPath
}

if file := c.String("file"); file != "" && c.Bool("write-artifacts") {
f, err := os.OpenFile(file, os.O_WRONLY, 0644)
if err != nil {
return fmt.Errorf("failed to write composition to file: %w", err)
}
enc := toml.NewEncoder(f)
if err := enc.Encode(comp); err != nil {
return fmt.Errorf("failed to encode composition into file: %w", err)
}
}
}

req := &client.RunRequest{
@@ -167,5 +167,11 @@ func doRun(c *cli.Context, comp *api.Composition) (err error) {

defer resp.Close()

return client.ParseRunResponse(resp)
rout, err := client.ParseRunResponse(resp)
if err != nil {
return err
}

logging.S().Infof("finished run with ID: %s", rout.RunID)
return nil
}
@@ -32,17 +32,12 @@ var SidecarCommand = cli.Command{
Allowed: sidecar.GetRunners(),
},
},
cli.StringFlag{
Name: "logs",
Required: false,
Usage: `Specifies where container STDERR/STDOUT should be written. If unspecified, the sidecar doesn't save the logs`,
},
},
}

func sidecarCommand(c *cli.Context) error {
if runtime.GOOS != "linux" {
return ErrNotLinux
}
return sidecar.Run(c.String("runner"), c.String("logs"))
return sidecar.Run(c.String("runner"))
}
@@ -13,14 +13,14 @@ author = "raulk"
[global]
plan = "dht"
case = "find-peers"
builder = "docker:go"
runner = "local:docker"
builder = "exec:go"
runner = "local:exec"

total_instances = 100
total_instances = 50

[[groups]]
id = "bootstrappers"
instances = { count = 50 }
instances = { count = 1 }

[groups.build]
dependencies = [
@@ -29,11 +29,11 @@ instances = { count = 50 }
]

[groups.run]
test_params = { random_walk = "true", n_bootstrap = "10" }
test_params = { random_walk = "true", n_bootstrap = "1" }

[[groups]]
id = "peers"
instances = { count = 50 }
instances = { count = 49 }

[groups.run]
test_params = { random_walk = "true", n_bootstrap = "10" }
test_params = { random_walk = "true", n_bootstrap = "1" }
9 go.mod
@@ -14,13 +14,14 @@ replace (

require (
github.com/BurntSushi/toml v0.3.1
github.com/aws/aws-sdk-go v1.25.48
github.com/aws/aws-sdk-go v1.28.9
github.com/containernetworking/cni v0.7.1
github.com/docker/docker v1.4.2-0.20191127125652-7c3d53ed640f
github.com/go-playground/validator/v10 v10.1.0
github.com/google/uuid v1.1.1
github.com/googleapis/gnostic v0.0.0-20190624222214-25d8b0b66985 // indirect
github.com/gorilla/mux v1.7.3
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-getter v1.4.0
github.com/hashicorp/go-multierror v1.0.0
github.com/imdario/mergo v0.3.8
@@ -34,9 +35,15 @@ require (
github.com/urfave/cli v1.22.1
github.com/vishvananda/netlink v1.0.0
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df
go.opencensus.io v0.22.2 // indirect
go.uber.org/zap v1.12.0
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d // indirect
golang.org/x/net v0.0.0-20191109021931-daa7c04131f5 // indirect
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
google.golang.org/api v0.10.0 // indirect
google.golang.org/appengine v1.6.2 // indirect
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a // indirect
google.golang.org/grpc v1.25.1 // indirect
k8s.io/api v0.17.0
k8s.io/apimachinery v0.17.0
k8s.io/client-go v0.0.0-20190706005506-4ed54556a14a
24 go.sum
@@ -24,8 +24,8 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA
github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM=
github.com/aws/aws-sdk-go v1.25.32 h1:GhqlDvuPXnlW46VoKvfLZkJj5IA6jGLO+/TUPCJSYOY=
github.com/aws/aws-sdk-go v1.25.32/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.25.48 h1:J82DYDGZHOKHdhx6hD24Tm30c2C3GchYGfN0mf9iKUk=
github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.28.9 h1:grIuBQc+p3dTRXerh5+2OxSuWFi0iXuxbFdTSg0jaW0=
github.com/aws/aws-sdk-go v1.28.9/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4=
github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
@@ -38,6 +38,7 @@ github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVa
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
@@ -79,6 +80,8 @@ github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
@@ -160,6 +163,8 @@ github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/U
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-getter v1.4.0 h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/fsKkw=
github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY=
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
@@ -179,6 +184,7 @@ github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/ipfs/go-cid v0.0.3 h1:UIAh32wymBpStoe83YCzwVQQ5Oy/H0FdxvUS6DJDzms=
github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-ipfs-util v0.0.1 h1:Wz9bL2wB2YBJqggkA4dD7oSmqB4cAnpNbGrlHJulv50=
github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc=
github.com/ipfs/testground v0.0.0-20200121194104-fd53f27ef027/go.mod h1:gawN4GBDQfpi0HWwh25ZXK/bSxZVoMEjdlpSmjJt2t8=
github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA=
@@ -309,6 +315,7 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8=
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
@@ -358,6 +365,8 @@ go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.1 h1:8dP3SGL7MPB94crU3bEPplMPe83FI4EouesJUeFHv50=
go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA=
go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0 h1:OI5t8sDa1Or+q8AeE+yKeB/SDYioSHAgcVljj9JIETY=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
@@ -412,6 +421,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwL
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI=
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191109021931-daa7c04131f5 h1:bHNaocaoJxYBo5cw41UyTMLjYlb8wPY7+WFrnklbHOM=
golang.org/x/net v0.0.0-20191109021931-daa7c04131f5/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -489,11 +500,15 @@ google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.9.0 h1:jbyannxz0XFD3zdjgrSUsaJbgpH4eTrkdhRChkHPfO8=
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/api v0.10.0 h1:7tmAxx3oKE98VMZ+SBZzvYYWRQ9HODBxmC8mXUsraSQ=
google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/appengine v1.6.2 h1:j8RI1yW0SkI+paT6uGwMlrMI/6zwYA6/CFil8rxOzGI=
google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
@@ -502,12 +517,17 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.23.1 h1:q4XQuHFC6I28BKZpo6IYyb3mNO+l7lSOxRuYTCiDfXk=
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -18,6 +18,7 @@ type Engine interface {

DoBuild(context.Context, *Composition, io.Writer) ([]*BuildOutput, error)
DoRun(context.Context, *Composition, io.Writer) (*RunOutput, error)
DoCollectOutputs(ctx context.Context, runner string, runID string, w io.Writer) error

EnvConfig() config.EnvConfig
Context() context.Context
@@ -27,6 +27,10 @@ type Runner interface {
// CompatibleBuilders returns the IDs of the builders whose artifacts this
// runner can work with.
CompatibleBuilders() []string

// CollectOutputs gathers the outputs from a run, and produces a zip file
// with the contents, writing it to the specified io.Writer.
CollectOutputs(context.Context, *CollectionInput, io.Writer) error
}

// RunInput encapsulates the input options for running a test plan.
@@ -75,7 +79,14 @@ type RunGroup struct {
}

type RunOutput struct {
// TODO.
// RunnerID is the ID of the runner used.
RunnerID string `json:"runnerId"`
RunID string
}

type CollectionInput struct {
// EnvConfig is the env configuration of the engine. Not a pointer to force
// a copy.
EnvConfig config.EnvConfig
RunID string
RunnerID string
}

0 comments on commit fd36888

Please sign in to comment.
You can’t perform that action at this time.