Skip to content

Commit

Permalink
enhance(executor tests): Add kubernetes runtime test cases for Opts a…
Browse files Browse the repository at this point in the history
…nd Secrets tests (#439)
  • Loading branch information
cognifloyd authored Mar 15, 2023
1 parent a70c97b commit e63ba7c
Show file tree
Hide file tree
Showing 2 changed files with 283 additions and 0 deletions.
11 changes: 11 additions & 0 deletions executor/linux/opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/go-vela/types/pipeline"
"github.com/go-vela/worker/runtime"
"github.com/go-vela/worker/runtime/docker"
"github.com/go-vela/worker/runtime/kubernetes"
"github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -432,6 +433,11 @@ func TestLinux_Opt_WithRuntime(t *testing.T) {
t.Errorf("unable to create docker runtime engine: %v", err)
}

_kubernetes, err := kubernetes.NewMock(testPod(false))
if err != nil {
t.Errorf("unable to create kubernetes runtime engine: %v", err)
}

// setup tests
tests := []struct {
name string
Expand All @@ -443,6 +449,11 @@ func TestLinux_Opt_WithRuntime(t *testing.T) {
failure: false,
runtime: _docker,
},
{
name: "kubernetes runtime",
failure: false,
runtime: _kubernetes,
},
{
name: "nil runtime",
failure: true,
Expand Down
Loading

0 comments on commit e63ba7c

Please sign in to comment.