Skip to content

Commit

Permalink
add serverless-contract-tests scenario (#17913)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalKalke authored Aug 2, 2023
1 parent d233f59 commit 5e0f755
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 3 additions & 3 deletions tests/function-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ serverless-integration: ## Run serverless integration scenario with kubectl prox
git-auth-integration: ## Run git authorization integration scenario with kubectl proxy
./run-local.sh git-auth-integration

.PHONY: simple-tracing
simple-tracing: ## Run simple tracing scenario with kubectl proxy
./run-local.sh simple-tracing
.PHONY: serverless-contract-tests
serverless-contract-tests: ## Run serverless contract tests with kubectl proxy
./run-local.sh serverless-contract-tests
6 changes: 4 additions & 2 deletions tests/function-controller/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ var availableScenarios = map[string][]scenario{
{displayName: "gitops", scenario: scenarios.GitopsSteps},
},
"git-auth-integration": {{displayName: "gitauth", scenario: scenarios.GitAuthTestSteps}},
"simple-tracing": {{displayName: "tracing", scenario: scenarios.SimpleFunctionTracingTest}},
"simple-api-gateway": {{displayName: "api-gateway", scenario: scenarios.SimpleFunctionAPIGatewayTest}},
"serverless-contract-tests": {
{displayName: "tracing", scenario: scenarios.SimpleFunctionTracingTest},
{displayName: "api-gateway", scenario: scenarios.SimpleFunctionAPIGatewayTest},
},
}

type config struct {
Expand Down
7 changes: 0 additions & 7 deletions tests/function-controller/testsuite/scenarios/api_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package scenarios
import (
"fmt"
"github.com/pkg/errors"
typedappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
"time"

"github.com/kyma-project/kyma/tests/function-controller/pkg/function"
Expand Down Expand Up @@ -41,11 +40,6 @@ func SimpleFunctionAPIGatewayTest(restConfig *rest.Config, cfg testsuite.Config,
return nil, errors.Wrap(err, "while creating k8s CoreV1Client")
}

appsCli, err := typedappsv1.NewForConfig(restConfig)
if err != nil {
return nil, errors.Wrapf(err, "while creating k8s apps client")
}

python39Logger := logf.WithField(scenarioKey, "python39")
nodejs16Logger := logf.WithField(scenarioKey, "nodejs16")
nodejs18Logger := logf.WithField(scenarioKey, "nodejs18")
Expand All @@ -68,7 +62,6 @@ func SimpleFunctionAPIGatewayTest(restConfig *rest.Config, cfg testsuite.Config,

return step.NewSerialTestRunner(logf, "Runtime test",
teststep.NewNamespaceStep("Create test namespace", coreCli, genericContainer),
teststep.NewApplication("Create HTTP basic application", HTTPAppName, HTTPAppImage, int32(80), appsCli.Deployments(genericContainer.Namespace), coreCli.Services(genericContainer.Namespace), genericContainer),
step.NewParallelRunner(logf, "Fn tests",
step.NewSerialTestRunner(python39Logger, "Python39 test",
teststep.CreateFunction(python39Logger, python39Fn, "Create Python39 Function", runtimes.BasicPythonFunction("Hello from python39", serverlessv1alpha2.Python39)),
Expand Down

0 comments on commit 5e0f755

Please sign in to comment.