Skip to content

e2e(plugins): e2e tests for plugin integration scenarios#1843

Open
abhijith-darshan wants to merge 1 commit intomainfrom
e2e/plugin-integration
Open

e2e(plugins): e2e tests for plugin integration scenarios#1843
abhijith-darshan wants to merge 1 commit intomainfrom
e2e/plugin-integration

Conversation

@abhijith-darshan
Copy link
Contributor

Description

E2E tests for plugin-plugin integration scenario

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

implements e2e test for direct reference and reference by selector

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@abhijith-darshan abhijith-darshan requested a review from a team as a code owner March 10, 2026 01:04
@abhijith-darshan abhijith-darshan force-pushed the e2e/plugin-integration branch 4 times, most recently from ba9f27c to 532d5b3 Compare March 10, 2026 02:15
@IvoGoman IvoGoman requested a review from Copilot March 10, 2026 17:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@abhijith-darshan abhijith-darshan force-pushed the e2e/plugin-integration branch 2 times, most recently from d855437 to 2ac5157 Compare March 12, 2026 14:16
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>
Comment on lines +144 to +152
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
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use test.NewPlugin() instead:

func NewPlugin(ctx context.Context, name, namespace string, opts ...func(*greenhousev1alpha1.Plugin)) *greenhousev1alpha1.Plugin {
GinkgoHelper()
plugin := &greenhousev1alpha1.Plugin{
TypeMeta: metav1.TypeMeta{
Kind: "Plugin",
APIVersion: greenhousev1alpha1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
}
for _, o := range opts {
o(plugin)
}
return plugin
}


By("creating resolver plugin")
resolverPlugin := &greenhousev1alpha1.Plugin{}
resolverPlugin.SetName("resolver-plugin")
Copy link
Contributor

Choose a reason for hiding this comment

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

Below the variable is used instead of the string value.

Suggested change
resolverPlugin.SetName("resolver-plugin")
resolverPlugin.SetName(directResolverPluginName)

Comment on lines +196 to +214
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
})
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's do it similar to other tests.

resolverPlugin := test.NewPlugin(..)
_, err := controllerutil.CreateOrPatch(..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] - Plugin Integration - E2E testing (OptionValues)

3 participants