Skip to content

Commit

Permalink
fix rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Dec 12, 2024
1 parent dbc028c commit da11a37
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
6 changes: 1 addition & 5 deletions e2e/aks-runtime/aks_runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import (

const testContainer = "testcontainer"

var imageReplacementsFile, namespaceFile, _platformStr string

func TestAKSRuntime(t *testing.T) {
require := require.New(t)

Expand Down Expand Up @@ -117,9 +115,7 @@ func TestAKSRuntime(t *testing.T) {
}

func TestMain(m *testing.M) {
flag.StringVar(&imageReplacementsFile, "image-replacements", "", "path to image replacements file")
flag.StringVar(&namespaceFile, "namespace-file", "", "file to store the namespace in")
flag.StringVar(&_platformStr, "platform", "", "Deployment platform")
contrasttest.RegisterFlags()
flag.Parse()

os.Exit(m.Run())
Expand Down
6 changes: 2 additions & 4 deletions e2e/genpolicy/genpolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestGenpolicy(t *testing.T) {

for name, deploy := range testCases {
t.Run(name, func(t *testing.T) {
ct := contrasttest.New(t, imageReplacementsFile, namespaceFile, platform)
ct := contrasttest.New(t)

ct.Init(t, kuberesource.PatchRuntimeHandlers([]any{deploy}, runtimeHandler))

Expand Down Expand Up @@ -69,9 +69,7 @@ func TestGenpolicy(t *testing.T) {
}

func TestMain(m *testing.M) {
flag.StringVar(&imageReplacementsFile, "image-replacements", "", "path to image replacements file")
flag.StringVar(&namespaceFile, "namespace-file", "", "file to store the namespace in")
flag.StringVar(&platformStr, "platform", "", "Deployment platform")
contrasttest.RegisterFlags()
flag.Parse()

os.Exit(m.Run())
Expand Down
6 changes: 2 additions & 4 deletions e2e/getdents/getdents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var imageReplacementsFile, namespaceFile, platformStr string
func TestGetDEnts(t *testing.T) {
platform, err := platforms.FromString(contrasttest.Flags.PlatformStr)
require.NoError(t, err)
ct := contrasttest.New(t, imageReplacementsFile, namespaceFile, platform)
ct := contrasttest.New(t)

runtimeHandler, err := manifest.RuntimeHandler(platform)
require.NoError(t, err)
Expand Down Expand Up @@ -86,9 +86,7 @@ func TestGetDEnts(t *testing.T) {
}

func TestMain(m *testing.M) {
flag.StringVar(&imageReplacementsFile, "image-replacements", "", "path to image replacements file")
flag.StringVar(&namespaceFile, "namespace-file", "", "file to store the namespace in")
flag.StringVar(&platformStr, "platform", "", "Deployment platform")
contrasttest.RegisterFlags()
flag.Parse()

os.Exit(m.Run())
Expand Down
4 changes: 1 addition & 3 deletions e2e/internal/contrasttest/contrasttest.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ type testFlags struct {
ImageReplacementsFile string
NamespaceFile string
NamespaceSuffix string
SkipUndeploy bool
}

// RegisterFlags registers the flags that are shared between all tests.
Expand All @@ -50,7 +49,6 @@ func RegisterFlags() {
flag.StringVar(&Flags.NamespaceFile, "namespace-file", "", "file to store the namespace in")
flag.StringVar(&Flags.NamespaceSuffix, "namespace-suffix", "", "suffix to append to the namespace")
flag.StringVar(&Flags.PlatformStr, "platform", "", "Deployment platform")
flag.BoolVar(&Flags.SkipUndeploy, "skip-undeploy", false, "Skip undeploying the test namespace")
}

// ContrastTest is the Contrast test helper struct.
Expand Down Expand Up @@ -79,7 +77,7 @@ func New(t *testing.T) *ContrastTest {
WorkDir: t.TempDir(),
ImageReplacementsFile: Flags.ImageReplacementsFile,
Platform: platform,
NamespaceFile: namespaceFile,
NamespaceFile: Flags.NamespaceFile,
Kubeclient: kubeclient.NewForTest(t),
}
}
Expand Down

0 comments on commit da11a37

Please sign in to comment.