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

Helm: helm-test task/goal #2667

Closed
manusa opened this issue Feb 14, 2024 · 3 comments · Fixed by #3409
Closed

Helm: helm-test task/goal #2667

manusa opened this issue Feb 14, 2024 · 3 comments · Fixed by #3409
Assignees
Labels
component/helm ⎈ enhancement New feature or request
Milestone

Comments

@manusa
Copy link
Member

manusa commented Feb 14, 2024

Helm: helm-test task/goal

#2667

Blocked by #2375

Description

As an Eclipse JKube user, I want to be able to run tests for a Helm chart release, so that I can verify that the release is working as expected.

Proposal

JKube Kit

JKube Kit exposes a new method test that runs the tests for the chart release with the name provided in the HelmConfig argument (or the one inferred from the project's configuration).

The chart should have been previously installed using the install method.

  • The tests are run by executing helm-java test command.
  • The user is able to provide the following test options through the HelmConfig:
    • releaseName: jkube.helm.release.name

      Optional, if not specified, the release name should be inferred following the same procedure used to compute default image and resource names.
    • timeout: jkube.helm.test.timeout

      Optional, timeout in seconds for the tests to complete.
  • If the tests succeed a message Tests for ${installName} passed is logged.
  • If the tests fail, error message is logged.

Maven plugins

The Kubernetes Maven Plugin and OpenShift Maven Plugin expose a new helm-test goal in a HelmTestMojo and OpenshiftHelmTestMojo that extends the basic HelmMojo (following a similar approach to that of HelmPushMojo and HelmLintMojo).

The mojos are bound by default to the LifecyclePhase.INSTALL phase.

Tests should be added for each of the mojos and also for KubernetesPluginTest, OpenShiftPluginTest, and GeneratedPluginDescriptorTest.

Gradle plugins

The Kubernetes Gradle Plugin and OpenShift Gradle Plugin expose a new helmTest task in a KubernetesHelmTestTask and OpenShiftHelmTestTask that extends the basic AbstractJKubeTask task.

Individual tests should be added for the new tasks and also for the plugins to verify task precedence.

An e2e test proves that the task can be executed.

Documentation

The documentation exposes for each of the Maven, Gradle, Kubernetes, and OpenShift plugins the new test goal/task.

It includes a section with the test options that can be provided in the HelmConfig argument and properties.

@manusa
Copy link
Member Author

manusa commented Oct 8, 2024

timeout setting is inconsistent.
We need to either set the option to testTimeout to make it test specific or the property to jkube.helm.timeout to make it global to the helm context.
Probably the former is the more convenient in case we add additional timeouts (such as for installhttps://github.com/manusa/helm-java/issues/170) and we want to allow users to provide different options for each goal.

@rohanKanojia
Copy link
Member

@manusa : Shall I update HelmServiceUtil to change property name to testTimeout?

@manusa
Copy link
Member Author

manusa commented Oct 8, 2024

If you can, yes (maybe in the scope of the docs PR).
Otherwise let me know and I'll update it after merging the docs PR.

@manusa manusa added this to the 1.18.0 milestone Oct 8, 2024 — with automated-tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/helm ⎈ enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants