Skip to content

Commit

Permalink
Revert "Enable receiving a rest config on TestSuite (kudobuilder#348)" (
Browse files Browse the repository at this point in the history
kudobuilder#359)

This reverts commit 769fd23.

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
  • Loading branch information
kensipe authored and iblancasa committed Nov 17, 2022
1 parent 0ac892b commit a165ed4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
3 changes: 0 additions & 3 deletions pkg/apis/testharness/v1beta1/test_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package v1beta1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/rest"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -68,8 +67,6 @@ type TestSuite struct {
Namespace string `json:"namespace"`
// Suppress is used to suppress logs
Suppress []string `json:"suppress"`

Config *rest.Config `json:"config,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
3 changes: 0 additions & 3 deletions pkg/test/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ func (h *Harness) Config() (*rest.Config, error) {

var err error
switch {
case h.TestSuite.Config != nil:
h.T.Log("running tests with passed rest config.")
h.config = h.TestSuite.Config
case h.TestSuite.StartControlPlane:
h.T.Log("running tests with a mocked control plane (kube-apiserver and etcd).")
h.config, err = h.RunTestEnv()
Expand Down
24 changes: 0 additions & 24 deletions pkg/test/harness_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/stretchr/testify/assert"

harness "github.com/kudobuilder/kuttl/pkg/apis/testharness/v1beta1"
testutils "github.com/kudobuilder/kuttl/pkg/test/utils"
)

func TestHarnessRunIntegration(t *testing.T) {
Expand All @@ -26,29 +25,6 @@ func TestHarnessRunIntegration(t *testing.T) {
harness.Run()
}

func TestHarnessRunIntegrationWithConfig(t *testing.T) {
testenv, err := testutils.StartTestEnvironment(nil, false)
if err != nil {
t.Fatalf("fatal error starting environment: %s", err)
}
harness := Harness{
TestSuite: harness.TestSuite{
TestDirs: []string{
"./test_data/",
},
// set as true to skip service account check
StartControlPlane: true,
Config: testenv.Config,
CRDDir: "./test_crds/",
},
T: t,
}
harness.Run()
if err := testenv.Environment.Stop(); err != nil {
t.Log("error tearing down mock control plane", err)
}
}

// This test requires external KinD support to run thus is an integration test
func TestRunBackgroundCommands(t *testing.T) {
h := Harness{
Expand Down

0 comments on commit a165ed4

Please sign in to comment.