Skip to content

Commit

Permalink
Merge branch 'main' into feat/oidc-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 authored May 30, 2024
2 parents d15c8c8 + bc88da1 commit 07708be
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 18 deletions.
14 changes: 7 additions & 7 deletions executor/linux/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestLinux_CreateBuild(t *testing.T) {
// setup types
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")
compiler, _ := native.New(cli.NewContext(nil, set, nil))
compiler, _ := native.FromCLIContext(cli.NewContext(nil, set, nil))

_build := testBuild()

Expand Down Expand Up @@ -220,7 +220,7 @@ func TestLinux_AssembleBuild_EnforceTrustedRepos(t *testing.T) {
// setup types
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")
compiler, _ := native.New(cli.NewContext(nil, set, nil))
compiler, _ := native.FromCLIContext(cli.NewContext(nil, set, nil))

_build := testBuild()

Expand Down Expand Up @@ -1050,7 +1050,7 @@ func TestLinux_PlanBuild(t *testing.T) {
// setup types
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")
compiler, _ := native.New(cli.NewContext(nil, set, nil))
compiler, _ := native.FromCLIContext(cli.NewContext(nil, set, nil))

_build := testBuild()

Expand Down Expand Up @@ -1232,7 +1232,7 @@ func TestLinux_AssembleBuild(t *testing.T) {
// setup types
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")
compiler, _ := native.New(cli.NewContext(nil, set, nil))
compiler, _ := native.FromCLIContext(cli.NewContext(nil, set, nil))

_build := testBuild()

Expand Down Expand Up @@ -1539,7 +1539,7 @@ func TestLinux_ExecBuild(t *testing.T) {
// setup types
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")
compiler, _ := native.New(cli.NewContext(nil, set, nil))
compiler, _ := native.FromCLIContext(cli.NewContext(nil, set, nil))

_build := testBuild()

Expand Down Expand Up @@ -1828,7 +1828,7 @@ func TestLinux_StreamBuild(t *testing.T) {
// setup types
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")
compiler, _ := native.New(cli.NewContext(nil, set, nil))
compiler, _ := native.FromCLIContext(cli.NewContext(nil, set, nil))

_build := testBuild()

Expand Down Expand Up @@ -2441,7 +2441,7 @@ func TestLinux_DestroyBuild(t *testing.T) {
// setup types
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")
compiler, _ := native.New(cli.NewContext(nil, set, nil))
compiler, _ := native.FromCLIContext(cli.NewContext(nil, set, nil))

_build := testBuild()

Expand Down
6 changes: 3 additions & 3 deletions executor/linux/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ func TestLinux_Secret_exec(t *testing.T) {
// setup types
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")
compiler, _ := native.New(cli.NewContext(nil, set, nil))
compiler, _ := native.FromCLIContext(cli.NewContext(nil, set, nil))

_build := testBuild()

Expand Down Expand Up @@ -1152,7 +1152,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) {
name: "secret with matching deployment event ACL injected",
step: &pipeline.Container{
Image: "alpine:latest",
Environment: map[string]string{"VELA_BUILD_EVENT": "deployment"},
Environment: map[string]string{"VELA_BUILD_EVENT": "deployment", "VELA_BUILD_EVENT_ACTION": "created"},
Secrets: pipeline.StepSecretSlice{{Source: "FOO", Target: "FOO"}},
},
msec: map[string]*library.Secret{
Expand All @@ -1169,7 +1169,7 @@ func TestLinux_Secret_injectSecret(t *testing.T) {
},
want: &pipeline.Container{
Image: "alpine:latest",
Environment: map[string]string{"FOO": "foo", "VELA_BUILD_EVENT": "deployment"},
Environment: map[string]string{"FOO": "foo", "VELA_BUILD_EVENT": "deployment", "VELA_BUILD_EVENT_ACTION": "created"},
},
},
{
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 @@ -30,7 +30,7 @@ func TestLinux_CreateStage(t *testing.T) {

set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")
compiler, _ := native.New(cli.NewContext(nil, set, nil))
compiler, _ := native.FromCLIContext(cli.NewContext(nil, set, nil))

_pipeline, _, err := compiler.
Duplicate().
Expand Down
48 changes: 42 additions & 6 deletions executor/local/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ import (

func TestLocal_CreateBuild(t *testing.T) {
// setup types
compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")

compiler, err := native.FromCLIContext(cli.NewContext(nil, set, nil))
if err != nil {
t.Errorf("unable to create compiler engine: %v", err)
}

_build := testBuild()

Expand Down Expand Up @@ -91,7 +97,13 @@ func TestLocal_CreateBuild(t *testing.T) {

func TestLocal_PlanBuild(t *testing.T) {
// setup types
compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")

compiler, err := native.FromCLIContext(cli.NewContext(nil, set, nil))
if err != nil {
t.Errorf("unable to create compiler engine: %v", err)
}

_build := testBuild()

Expand Down Expand Up @@ -170,7 +182,13 @@ func TestLocal_PlanBuild(t *testing.T) {

func TestLocal_AssembleBuild(t *testing.T) {
// setup types
compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")

compiler, err := native.FromCLIContext(cli.NewContext(nil, set, nil))
if err != nil {
t.Errorf("unable to create compiler engine: %v", err)
}

_build := testBuild()

Expand Down Expand Up @@ -283,7 +301,13 @@ func TestLocal_AssembleBuild(t *testing.T) {

func TestLocal_ExecBuild(t *testing.T) {
// setup types
compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")

compiler, err := native.FromCLIContext(cli.NewContext(nil, set, nil))
if err != nil {
t.Errorf("unable to create compiler engine: %v", err)
}

_build := testBuild()

Expand Down Expand Up @@ -381,7 +405,13 @@ func TestLocal_ExecBuild(t *testing.T) {

func TestLocal_StreamBuild(t *testing.T) {
// setup types
compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")

compiler, err := native.FromCLIContext(cli.NewContext(nil, set, nil))
if err != nil {
t.Errorf("unable to create compiler engine: %v", err)
}

_build := testBuild()

Expand Down Expand Up @@ -591,7 +621,13 @@ func TestLocal_StreamBuild(t *testing.T) {

func TestLocal_DestroyBuild(t *testing.T) {
// setup types
compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")

compiler, err := native.FromCLIContext(cli.NewContext(nil, set, nil))
if err != nil {
t.Errorf("unable to create compiler engine: %v", err)
}

_build := testBuild()

Expand Down
8 changes: 7 additions & 1 deletion executor/local/stage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ func TestLocal_CreateStage(t *testing.T) {
_file := "testdata/build/stages/basic.yml"
_build := testBuild()

compiler, _ := native.New(cli.NewContext(nil, flag.NewFlagSet("test", 0), nil))
set := flag.NewFlagSet("test", 0)
set.String("clone-image", "target/vela-git:latest", "doc")

compiler, err := native.FromCLIContext(cli.NewContext(nil, set, nil))
if err != nil {
t.Errorf("unable to create compiler from CLI context: %v", err)
}

_pipeline, _, err := compiler.
Duplicate().
Expand Down

0 comments on commit 07708be

Please sign in to comment.