Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kind multi-cluster envtests #40

Merged

Conversation

Miles-Garnsey
Copy link
Member

@Miles-Garnsey Miles-Garnsey commented May 3, 2024

Adds multi-cluster envtests using kind as a backend.

Fixes: #41

@Miles-Garnsey Miles-Garnsey force-pushed the feature/kind-envtests-experimental branch from 31ff107 to d64219a Compare May 3, 2024 05:29
@Miles-Garnsey Miles-Garnsey force-pushed the feature/kind-envtests-experimental branch from 8d494c3 to 13b1b74 Compare May 27, 2024 07:44
@Miles-Garnsey Miles-Garnsey force-pushed the feature/kind-envtests-experimental branch from 13b1b74 to cc27de4 Compare May 28, 2024 01:37
Straighten out contexts.

Addtnl error handling.

Spawn kind clusters in parallel.

Fix variable capture, try to get teardown working.

Parallel cleanup.

Make number of nodes per k8s cluster configurable, drop nodes to 1 per cluster for registration test.
@Miles-Garnsey Miles-Garnsey force-pushed the feature/kind-envtests-experimental branch from cc27de4 to 5c3e445 Compare May 28, 2024 01:51
// This relies on a controller that is not running in the envtest.
res := ex.RegisterCluster()
return res == nil
}, time.Second*300, time.Second*1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Reduce the polling interval (and the maximum time so that we bailout faster). I reduced these already to speed up the test from 16s to 2.4s and I'd hate to see the test taking more time than necessary.

}
}
return err1 == nil && err2 == nil
}, time.Second*60, time.Second*2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Reduce the polling interval (and the maximum time so that we bailout faster). I reduced these already to speed up the test from 16s to 2.4s and I'd hate to see the test taking more time than necessary.

require.Eventually(func() bool {
err := client1.Get(ctx, types.NamespacedName{Name: "k8ssandra-operator-secret", Namespace: "source-namespace"}, sourceSecret)
return err == nil
}, time.Second*60, time.Second*5)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Reduce the polling interval (and the maximum time so that we bailout faster). I reduced these already to speed up the test from 16s to 2.4s and I'd hate to see the test taking more time than necessary.

@@ -127,15 +111,14 @@ func TestRegister(t *testing.T) {
return false
}
return err == nil
}, time.Second*6, time.Millisecond*100)

}, time.Second*60, time.Second*2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Reduce the polling interval (and the maximum time so that we bailout faster). I reduced these already to speed up the test from 16s to 2.4s and I'd hate to see the test taking more time than necessary.

)

func TestMain(m *testing.M) {
// metrics.DefaultBindAddress = "0" This no longer appears to exist...
os.Exit(envtest.RunMulti(m, func(e *envtest.MultiK8sEnvironment) {
testDir, err = os.MkdirTemp("", "k8ssandra-operator-test")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: This isn't k8ssandra-operator..

@Miles-Garnsey Miles-Garnsey merged commit b82eec7 into k8ssandra:main Jun 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add kind backed envtests
3 participants