Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Added make targets to run E2E tests on ephemeral clusters #108

Merged
merged 4 commits into from
Nov 21, 2024

Conversation

shanduur
Copy link
Contributor

@shanduur shanduur commented Nov 7, 2024

This PR introduces Makefile targets to improve tool management and to enable streamlined execution of end-to-end (E2E) tests. It enhances the setup for managing dependencies and testing within the CI pipeline.

Key Changes:

  1. Tool Management:

    • Introduced new Makefile targets to manage development tools, including:
      • golangci-lint
      • ctlptl
      • kind
      • kustomize
      • chainsaw
    • Defined versions for these tools in a hack/tools/go.mod file to ensure consistent versions across environments.
    • Added a reusable go-install-tool helper function to facilitate tool installation, reducing manual setup steps.
  2. Cluster and Deployment Management:

    • Added targets to automate cluster setup and teardown with ctlptl and kind, including cluster and cluster-reset targets.
    • Created deploy and undeploy targets for simplified Kubernetes deployment, using kubectl and kustomize.
  3. E2E Test Execution:

    • Updated the Makefile to run E2E tests using chainsaw with a dedicated test-e2e target.
    • Configured chainsaw to use test/e2e/values.yaml for test values, ensuring tests are executed with predefined settings.
  4. Kustomization and Resource Changes:

    • Updated various controller resources for consistency in naming and structure:
      • Modified namespaces, name prefixes, and resource names to align with container-object-storage-system.
    • Added a new namespace.yaml resource under controller/resources.
  5. Additional Updates:

    • Minor syntax and path adjustments in resource files.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 7, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 7, 2024
@shanduur shanduur marked this pull request as ready for review November 7, 2024 07:37
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 7, 2024
@shanduur
Copy link
Contributor Author

shanduur commented Nov 7, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Nov 7, 2024
Makefile Outdated
Comment on lines 156 to 159
## Location to install dependencies to
TOOLBIN ?= $(CURDIR)/.cache/tools
$(TOOLBIN):
mkdir -p $(TOOLBIN)
Copy link
Contributor

Choose a reason for hiding this comment

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

I have found that go mod vendor seems to be a simpler way of downloading tools to a local cache. I used that method with the client generator and found it worked well. Then we can get rid of go-install-tool entirely for something like

tools:
  cd hack/tools && go mod vendor -o $(TOOLBIN)

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't like the fact that go run <tool> does not cache, and always rebuilds the binary. While not an issue in CI, this is not the best for local development.

Copy link
Contributor

@BlaineEXE BlaineEXE left a comment

Choose a reason for hiding this comment

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

It sounds like you plan to make a small change or two, so I will hold off on adding the approve/lgtm labels for now. Thanks for doing this work and answering my questions about the methods!

@BlaineEXE
Copy link
Contributor

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 21, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BlaineEXE, shanduur

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 15bf2bb into kubernetes-retired:monorepo Nov 21, 2024
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants