Skip to content

Enhance E2E Test Scaffold with Optional Prometheus and Cert-Manager Installation #4089

Closed
@camilamacedo86

Description

@camilamacedo86

What do you want to happen?

Projects are scaffolded with e2e tests, which by default, should be executed in a specific environment. The common practice is to spin up an environment, run the tests, and then tear down the environment to ensure the tests are executed in isolation.

However, some users might prefer to run these tests in an environment where Prometheus and Cert-Manager are already installed, or in cases where their project does not require these tools. Users should still be able to customize their scaffold as needed. (Motivation: #3971)

To facilitate this, we can add a logic that uses an environment variable to skip the installation of these tools, such as INSTALL_PROMETHEUS_E2E_TEST=false.

The changes should be made in the following section of the code:

var _ = Describe("controller", Ordered, func() {
BeforeAll(func() {
By("installing prometheus operator")
Expect(utils.InstallPrometheusOperator()).To(Succeed())
By("installing the cert-manager")
Expect(utils.InstallCertManager()).To(Succeed())
By("creating manager namespace")
cmd := exec.Command("kubectl", "create", "ns", namespace)
_, _ = utils.Run(cmd)
})

Additionally, we have a practice of adding TODO(user): comments. We must ensure that this code includes comments explaining how the tests should be used and describing the ability to disable the installation of Prometheus and Cert-Manager in the e2e tests.

Extra Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions