Skip to content

Commit

Permalink
fix(executor): tests from compiler changes (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockopp authored May 3, 2022
1 parent e17c12a commit e1e72a2
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 36 deletions.
18 changes: 12 additions & 6 deletions executor/linux/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ func TestLinux_CreateBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithMetadata(_metadata).
Expand Down Expand Up @@ -182,7 +183,8 @@ func TestLinux_PlanBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithMetadata(_metadata).
Expand Down Expand Up @@ -323,7 +325,8 @@ func TestLinux_AssembleBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithMetadata(_metadata).
Expand Down Expand Up @@ -435,7 +438,8 @@ func TestLinux_ExecBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithMetadata(_metadata).
Expand Down Expand Up @@ -695,7 +699,8 @@ func TestLinux_StreamBuild(t *testing.T) {

streamRequests := make(chan message.StreamRequest)

_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithMetadata(_metadata).
Expand Down Expand Up @@ -834,7 +839,8 @@ func TestLinux_DestroyBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithMetadata(_metadata).
Expand Down
6 changes: 5 additions & 1 deletion executor/linux/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,16 @@ func TestLinux_Secret_exec(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
file, _ := ioutil.ReadFile(test.pipeline)

p, _ := compiler.
p, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithUser(_user).
WithMetadata(_metadata).
Compile(file)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err)
}

_engine, err := New(
WithBuild(_build),
Expand Down
3 changes: 2 additions & 1 deletion executor/linux/stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ func TestLinux_CreateStage(t *testing.T) {

compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))

_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithMetadata(_metadata).
Expand Down
18 changes: 12 additions & 6 deletions executor/local/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func TestLocal_CreateBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithLocal(true).
Expand Down Expand Up @@ -132,7 +133,8 @@ func TestLocal_PlanBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithLocal(true).
Expand Down Expand Up @@ -247,7 +249,8 @@ func TestLocal_AssembleBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithLocal(true).
Expand Down Expand Up @@ -348,7 +351,8 @@ func TestLocal_ExecBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithLocal(true).
Expand Down Expand Up @@ -541,7 +545,8 @@ func TestLocal_StreamBuild(t *testing.T) {

streamRequests := make(chan message.StreamRequest)

_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithLocal(true).
Expand Down Expand Up @@ -659,7 +664,8 @@ func TestLocal_DestroyBuild(t *testing.T) {
// run test
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithLocal(true).
Expand Down
3 changes: 2 additions & 1 deletion executor/local/stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ func TestLocal_CreateStage(t *testing.T) {

compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))

_pipeline, err := compiler.
_pipeline, _, err := compiler.
Duplicate().
WithBuild(_build).
WithRepo(_repo).
WithLocal(true).
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ require (
github.com/docker/go-units v0.4.0
github.com/gin-gonic/gin v1.7.7
github.com/go-vela/sdk-go v0.13.1
github.com/go-vela/server v0.13.1
github.com/go-vela/types v0.13.1-0.20220426202924-efda5bc01281
github.com/go-vela/server v0.14.0-rc1
github.com/go-vela/types v0.14.0-rc1
github.com/google/go-cmp v0.5.8
github.com/joho/godotenv v1.4.0
github.com/opencontainers/image-spec v1.0.2
Expand Down Expand Up @@ -50,11 +50,11 @@ require (
github.com/go-playground/locales v0.13.0 // indirect
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/go-playground/validator/v10 v10.4.1 // indirect
github.com/go-redis/redis/v8 v8.11.4 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.0 // indirect
github.com/golang-jwt/jwt/v4 v4.4.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-github/v42 v42.0.0 // indirect
github.com/google/go-github/v44 v44.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
Expand All @@ -63,7 +63,7 @@ require (
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -83,15 +83,15 @@ require (
github.com/prometheus/procfs v0.7.3 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/afero v1.8.1 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/ugorji/go/codec v1.1.11 // indirect
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect
go.starlark.net v0.0.0-20220328144851-d1966c6b9fcd // indirect
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
Expand Down
Loading

0 comments on commit e1e72a2

Please sign in to comment.