e2e(plugins): e2e tests for plugin integration scenarios#1843
e2e(plugins): e2e tests for plugin integration scenarios#1843abhijith-darshan wants to merge 1 commit intomainfrom
Conversation
ba9f27c to
532d5b3
Compare
There was a problem hiding this comment.
Pull request overview
Adds new end-to-end coverage for plugin→plugin integration, validating that option values can be resolved from (1) a direct plugin reference and (2) a label-selector-based reference, and wires this into the existing plugin e2e suite.
Changes:
- Introduces new plugin integration e2e scenarios (direct reference + selector-based reference) with assertions against HelmRelease values and remote deployments.
- Updates existing flux-controller e2e scenarios and fixtures to use the appropriate (Cluster)PluginDefinition helpers/signatures.
- Enables plugin integration feature flag in the dev environment values used by e2e config.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| e2e/plugin/scenarios/plugin_integration.go | New integration scenarios for direct and selector-based value resolution, plus remote deployment verification. |
| e2e/plugin/scenarios/flux_controller.go | Adapts scenarios to updated fixture helpers and removes unused params in some scenario functions. |
| e2e/plugin/fixtures/fixtures.go | Splits helpers for PluginDefinition vs ClusterPluginDefinition and adds a PodInfo PluginDefinition helper. |
| e2e/plugin/e2e_test.go | Adds two new e2e test cases (direct ref + selector ref) and onboards a second remote cluster for integration. |
| dev-env/dev.values.yaml | Turns on global.plugin.integrationEnabled so the integration scenarios can run in the e2e-installed chart. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d855437 to
2ac5157
Compare
Remove unused args and methods Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com> (chore): adds tracking id annotation check Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com> Automatic application of license header (chore): debug logging Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com> (chore): change env prefix for direct ref Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com> (chore): debug logging Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com> (chore): enable plugin integration feature toggle remove debug logging Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com> (chore): fix tracking id eventually Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com> Update e2e/plugin/scenarios/plugin_integration.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> (chore): fetch resource to get updated annotations Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com> (chore): verify values resolved in helm release with test generated Signed-off-by: abhijith-darshan <abhijith.ravindra@sap.com>
2ac5157 to
83b6880
Compare
| func generatePlugin(name, namespace string, opts ...func(*greenhousev1alpha1.Plugin)) *greenhousev1alpha1.Plugin { | ||
| plugin := &greenhousev1alpha1.Plugin{} | ||
| plugin.SetName(name) | ||
| plugin.SetNamespace(namespace) | ||
| for _, o := range opts { | ||
| o(plugin) | ||
| } | ||
| return plugin | ||
| } |
There was a problem hiding this comment.
Please use test.NewPlugin() instead:
greenhouse/internal/test/resources.go
Lines 455 to 471 in b874ced
|
|
||
| By("creating resolver plugin") | ||
| resolverPlugin := &greenhousev1alpha1.Plugin{} | ||
| resolverPlugin.SetName("resolver-plugin") |
There was a problem hiding this comment.
Below the variable is used instead of the string value.
| resolverPlugin.SetName("resolver-plugin") | |
| resolverPlugin.SetName(directResolverPluginName) |
| resolverPlugin := &greenhousev1alpha1.Plugin{} | ||
| resolverPlugin.SetName("resolver-plugin") | ||
| resolverPlugin.SetNamespace(env.TestNamespace) | ||
| _, err = controllerutil.CreateOrPatch(ctx, adminClient, resolverPlugin, func() error { | ||
| resolverPlugin.Spec = generatePlugin( | ||
| directResolverPluginName, | ||
| env.TestNamespace, | ||
| test.WithPluginDefinition(testPluginDefinition.Name), | ||
| test.WithPluginOptionValue("replicaCount", &apiextensionsv1.JSON{Raw: []byte("1")}), | ||
| test.WithReleaseName(directResolverPluginName+"-release"), | ||
| test.WithReleaseNamespace(directResolverPluginName+"-namespace"), | ||
| test.WithCluster(remoteClusterName), | ||
| test.WithPluginOptionValueFromRef("extraEnvs", &greenhousev1alpha1.ExternalValueSource{ | ||
| Name: pluginDirectRef.Name, | ||
| Expression: "object.spec.optionValues.filter(o, o.name == 'extraEnvs')[0].value", | ||
| }), | ||
| ).Spec | ||
| return nil | ||
| }) |
There was a problem hiding this comment.
Let's do it similar to other tests.
resolverPlugin := test.NewPlugin(..)
_, err := controllerutil.CreateOrPatch(..)
Description
E2E tests for plugin-plugin integration scenario
What type of PR is this? (check all applicable)
Related Tickets & Documents
Added tests?
implements e2e test for direct reference and reference by selector
Added to documentation?
Checklist