-
Notifications
You must be signed in to change notification settings - Fork 394
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
🌱 run replication tests on a shared kcp instance #2620
🌱 run replication tests on a shared kcp instance #2620
Conversation
/test e2e-sharded |
ctx, cancel := context.WithCancel(context.Background()) | ||
t.Cleanup(cancel) | ||
|
||
// TODO (p0lyn0mial): detect the type of the env we are running on (single vs multi-shard) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, ci/prow/e2e-sharded
keeps failing so I need to fix it in this PR :)
83f84c1
to
a18bd4a
Compare
/retest |
a standalone version of the cache server is tested on a multi-shard environment(in TestReplication test).
a helper function for creating a rest config for the cache server depending on the underlying test environment.
a18bd4a
to
7702dde
Compare
the CI jobs wait for the admin kubeconfig before running the tests. creating the kubeconfig after the shards are ready makes sure that the shards are registered and that the env is stable.
"Shard", | ||
corev1alpha1.SchemeGroupVersion.WithResource("shards"), | ||
&corev1alpha1.Shard{ | ||
ObjectMeta: metav1.ObjectMeta{Name: "test-shard"}, | ||
ObjectMeta: metav1.ObjectMeta{Name: withPseudoRandomSuffix("test-shard")}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can all or most of these use GenerateName?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we could do that but that would require some/bigger changes because the tests need stable name so that they can find resources for modification/deletion.
I can prepare a follow-up PR for that^
err := <-terminatedCh | ||
shardsErrCh <- indexErrTuple{i, err} | ||
}(i, terminatedCh) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I explained in the commit msg, have a look eb96d8b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// intended to be common between fixture for servers whose lifecycle | ||
// is test-managed and fixture for servers whose lifecycle is managed | ||
// separately from a test run. | ||
func loadKubeConfig(kubeconfigPath string) (clientcmd.ClientConfig, error) { | ||
func LoadKubeConfig(kubeconfigPath, contextName string) (clientcmd.ClientConfig, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this? We shouldn't build a helper library for kube.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to avoid copying of code that loads a kubeconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sttts k8s libraries have just a little too much power, every project I've ever seen has their own simplification to not copy-paste ...
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: stevekuznetsov The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
previously all scenarios were run in a private environment. After the change only the scenarios that are disruptive run in a sandbox, the rest is run on a shared kcp instance (either on a single or multi-shard env)
This change allows us to run non-disruptive scenarios on a multi-shard cluster.
Related issue(s)
#2596
kcp-dev/contrib-tmc#84