github.com/kubeshop/testkube@v1.17.23/contrib/executor/ginkgo/pkg/runner/runner_test.go (about)

     1  package runner
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  
     8  	"github.com/kubeshop/testkube/pkg/api/v1/testkube"
     9  )
    10  
    11  func TestRun(t *testing.T) {
    12  	t.Parallel()
    13  
    14  	t.Run("FindGoinkgoParams should override default params when provided with new value", func(t *testing.T) {
    15  		t.Parallel()
    16  
    17  		defaultParams := InitializeGinkgoParams()
    18  		variables := make(map[string]testkube.Variable)
    19  		variableOne := testkube.Variable{
    20  			Name:  "GinkgoTestPackage",
    21  			Value: "e2e",
    22  			Type_: testkube.VariableTypeBasic,
    23  		}
    24  		variableTwo := testkube.Variable{
    25  			Name:  "GinkgoRecursive",
    26  			Value: "",
    27  			Type_: testkube.VariableTypeBasic,
    28  		}
    29  		variables["GinkgoTestPackage"] = variableOne
    30  		variables["GinkgoRecursive"] = variableTwo
    31  		execution := testkube.Execution{
    32  			Variables: variables,
    33  		}
    34  		mappedParams := FindGinkgoParams(&execution, defaultParams)
    35  		assert.Equal(t, "e2e", mappedParams["GinkgoTestPackage"])
    36  		assert.Equal(t, "", mappedParams["GinkgoRecursive"])
    37  	})
    38  }