Skip to content

Commit

Permalink
fix(tests): pass context into Compile (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Sep 20, 2024
1 parent db0fc08 commit a26112c
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 97 deletions.
12 changes: 6 additions & 6 deletions executor/linux/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestLinux_CreateBuild(t *testing.T) {
Duplicate().
WithBuild(_build).
WithRepo(_build.GetRepo()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err)
}
Expand Down Expand Up @@ -325,7 +325,7 @@ func TestLinux_PlanBuild(t *testing.T) {
Duplicate().
WithBuild(_build).
WithRepo(_build.GetRepo()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err)
}
Expand Down Expand Up @@ -608,7 +608,7 @@ func TestLinux_AssembleBuild(t *testing.T) {
Duplicate().
WithBuild(_build).
WithRepo(_build.GetRepo()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err)
}
Expand Down Expand Up @@ -843,7 +843,7 @@ func TestLinux_ExecBuild(t *testing.T) {
Duplicate().
WithBuild(_build).
WithRepo(_build.GetRepo()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err)
}
Expand Down Expand Up @@ -1486,7 +1486,7 @@ func TestLinux_StreamBuild(t *testing.T) {
Duplicate().
WithBuild(_build).
WithRepo(_build.GetRepo()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err)
}
Expand Down Expand Up @@ -1760,7 +1760,7 @@ func TestLinux_DestroyBuild(t *testing.T) {
Duplicate().
WithBuild(_build).
WithRepo(_build.GetRepo()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile %s pipeline %s: %v", test.name, test.pipeline, err)
}
Expand Down
2 changes: 1 addition & 1 deletion executor/linux/outputs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func TestLinux_Outputs_exec(t *testing.T) {
WithBuild(_build).
WithRepo(_build.GetRepo()).
WithUser(_build.GetRepo().GetOwner()).
Compile(file)
Compile(context.Background(), file)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err)
}
Expand Down
2 changes: 1 addition & 1 deletion executor/linux/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func TestLinux_Secret_exec(t *testing.T) {
WithBuild(_build).
WithRepo(_build.GetRepo()).
WithUser(_build.GetRepo().GetOwner()).
Compile(file)
Compile(context.Background(), file)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err)
}
Expand Down
2 changes: 1 addition & 1 deletion executor/linux/stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestLinux_CreateStage(t *testing.T) {
WithBuild(_build).
WithRepo(_build.GetRepo()).
WithUser(_build.GetRepo().GetOwner()).
Compile(_file)
Compile(context.Background(), _file)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", _file, err)
}
Expand Down
12 changes: 6 additions & 6 deletions executor/local/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestLocal_CreateBuild(t *testing.T) {
WithRepo(_build.GetRepo()).
WithLocal(true).
WithUser(_build.GetRepo().GetOwner()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err)
}
Expand Down Expand Up @@ -143,7 +143,7 @@ func TestLocal_PlanBuild(t *testing.T) {
WithRepo(_build.GetRepo()).
WithLocal(true).
WithUser(_build.GetRepo().GetOwner()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err)
}
Expand Down Expand Up @@ -261,7 +261,7 @@ func TestLocal_AssembleBuild(t *testing.T) {
WithRepo(_build.GetRepo()).
WithLocal(true).
WithUser(_build.GetRepo().GetOwner()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err)
}
Expand Down Expand Up @@ -365,7 +365,7 @@ func TestLocal_ExecBuild(t *testing.T) {
WithRepo(_build.GetRepo()).
WithLocal(true).
WithUser(_build.GetRepo().GetOwner()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err)
}
Expand Down Expand Up @@ -561,7 +561,7 @@ func TestLocal_StreamBuild(t *testing.T) {
WithRepo(_build.GetRepo()).
WithLocal(true).
WithUser(_build.GetRepo().GetOwner()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err)
}
Expand Down Expand Up @@ -682,7 +682,7 @@ func TestLocal_DestroyBuild(t *testing.T) {
WithRepo(_build.GetRepo()).
WithLocal(true).
WithUser(_build.GetRepo().GetOwner()).
Compile(test.pipeline)
Compile(context.Background(), test.pipeline)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", test.pipeline, err)
}
Expand Down
2 changes: 1 addition & 1 deletion executor/local/stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestLocal_CreateStage(t *testing.T) {
WithRepo(_build.GetRepo()).
WithLocal(true).
WithUser(_build.GetRepo().GetOwner()).
Compile(_file)
Compile(context.Background(), _file)
if err != nil {
t.Errorf("unable to compile pipeline %s: %v", _file, err)
}
Expand Down
43 changes: 22 additions & 21 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.5.0
github.com/gin-gonic/gin v1.10.0
github.com/go-vela/sdk-go v0.24.0
github.com/go-vela/server v0.24.1
github.com/go-vela/types v0.24.1-0.20240813201820-772b29b91a5e
github.com/go-vela/server v0.24.3-0.20240920134429-f31811890bd4
github.com/go-vela/types v0.24.1-0.20240826141537-76a66e72d5dc
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/go-cmp v0.6.0
github.com/joho/godotenv v1.5.1
Expand All @@ -21,11 +21,13 @@ require (
golang.org/x/sync v0.7.0
gotest.tools/v3 v3.5.1
k8s.io/api v0.30.2
k8s.io/apimachinery v0.30.2
k8s.io/apimachinery v0.30.3
k8s.io/client-go v0.30.2
sigs.k8s.io/yaml v1.4.0
)

require github.com/google/go-github/v63 v63.0.0 // indirect

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
Expand All @@ -36,9 +38,9 @@ require (
github.com/alicebob/miniredis/v2 v2.33.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/buildkite/yaml v0.0.0-20230306222819-0e4e032d4835 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic v1.11.9 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/containerd/containerd v1.7.11 // indirect
Expand All @@ -52,23 +54,22 @@ require (
github.com/drone/envsubst v1.0.3 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/go-playground/validator/v10 v10.22.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-github/v62 v62.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.6.0 // indirect
Expand All @@ -82,7 +83,7 @@ require (
github.com/imdario/mergo v0.3.13 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
Expand All @@ -106,7 +107,7 @@ require (
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/redis/go-redis/v9 v9.5.3 // indirect
github.com/redis/go-redis/v9 v9.6.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
Expand All @@ -117,22 +118,22 @@ require (
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
github.com/yuin/gopher-lua v1.1.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel v1.19.0 // indirect
go.opentelemetry.io/otel/metric v1.19.0 // indirect
go.opentelemetry.io/otel/trace v1.19.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.starlark.net v0.0.0-20240314022150-ee8ed142361c // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/protobuf v1.34.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit a26112c

Please sign in to comment.