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

Add Helm E2E tests #1769

Open
ArangoGutierrez opened this issue Jul 9, 2024 · 6 comments
Open

Add Helm E2E tests #1769

ArangoGutierrez opened this issue Jul 9, 2024 · 6 comments
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@ArangoGutierrez
Copy link
Contributor

What would you like to be added:
Now that we are running the E2E with Kind and we have more flexibility over our E2E infra we should include a small test suite for running via Helm deployment.

Why is this needed:
Currently, E2E deploys objects from code, leaving Helm charts untested. E2E could pass but Helm charts be broken and we won't tell until a manual test.

/help
/good-first-issue

@ArangoGutierrez ArangoGutierrez added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 9, 2024
@k8s-ci-robot
Copy link
Contributor

@ArangoGutierrez:
This request has been marked as suitable for new contributors.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

What would you like to be added:
Now that we are running the E2E with Kind and we have more flexibility over our E2E infra we should include a small test suite for running via Helm deployment.

Why is this needed:
Currently, E2E deploys objects from code, leaving Helm charts untested. E2E could pass but Helm charts be broken and we won't tell until a manual test.

/help
/good-first-issue

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jul 9, 2024
@THUzxj
Copy link

THUzxj commented Jul 10, 2024

Hi, I would like to work on this. I might need to spend some time understanding this project first. Thanks!

@TessaIO
Copy link
Member

TessaIO commented Jul 10, 2024

Hi, I would like to work on this. I might need to spend some time understanding this project first. Thanks!

lmk if you need any guidance with that!

@THUzxj
Copy link

THUzxj commented Jul 13, 2024

Hi @TessaIO , thank you for offering help. I am struggling to run the e2e test locally. Since the Makefile doesn't provide scripts to create the testing environment, I'd like to use Kind. Here is my practice to run the e2e test:

kind create cluster
# in source dir
make image-all
kind load docker-image  registry.k8s.io/nfd/node-feature-discovery:xxxx
make test-e2e

However, I am faced with the problem that Kind still complains "Failed to pull image" error and I am investigating this.

Thus I would appreciate it if you could answer these questions: Do you run the e2e tests locally when developing? If so, do you have some recommended ways?

@TessaIO
Copy link
Member

TessaIO commented Jul 14, 2024

Hi @THUzxj,
Your setup is correct. Few params need to be tweaked here. When u run make test-e2e you can see this code snippet in the Makefile file:

e2e-test:
	@if [ -z ${KUBECONFIG} ]; then echo "[ERR] KUBECONFIG missing, must be defined"; exit 1; fi
	$(GO_CMD) test -timeout=1h -v ./test/e2e/ -args \
	    -nfd.repo=$(IMAGE_REPO) -nfd.tag=$(IMAGE_TAG_NAME) \
	    -kubeconfig=$(KUBECONFIG) \
	    -nfd.e2e-config=$(E2E_TEST_CONFIG) \
	    -nfd.pull-if-not-present=$(E2E_PULL_IF_NOT_PRESENT) \
	    -ginkgo.focus="\[k8s-sigs\/node-feature-discovery\]" \
	    -ginkgo.label-filter=$(E2E_GINKGO_LABEL_FILTER) \
	    -ginkgo.v \
	    $(if $(OPENSHIFT),-nfd.openshift,)
	if [ "$(E2E_TEST_FULL_IMAGE)" = "true" ]; then \
	    $(GO_CMD) test -timeout=1h -v ./test/e2e/ -args \
	        -nfd.repo=$(IMAGE_REPO) -nfd.tag=$(IMAGE_TAG_NAME)-full \
	        -kubeconfig=$(KUBECONFIG) \
	        -nfd.e2e-config=$(E2E_TEST_CONFIG) \
	        -nfd.pull-if-not-present=$(E2E_PULL_IF_NOT_PRESENT) \
	        -ginkgo.focus="\[k8s-sigs\/node-feature-discovery\]" \
	        -ginkgo.label-filter=$(E2E_GINKGO_LABEL_FILTER) \
	        -ginkgo.v \
	        $(if $(OPENSHIFT),-nfd.openshift,); \
	fi

As you can see that nfd.tag is equal to the IMAGE_TAG_NAME which is equal to the value of this command:

$(shell git describe --tags --dirty --always)

So in a nutshell, you're e2e-test command would try to pull node-feature-discovery:smth-random-here
You have two ways here:
1- If you want to run tests against the latest version you need to change version in you Makefile to point 0.16.1 or whatever u want
2- Build and push your own image using:

make image
make push

and then run your e2e-tests

/assign @THUzxj

@marquiz
Copy link
Contributor

marquiz commented Jul 15, 2024

However, I am faced with the problem that Kind still complains "Failed to pull image" error and I am investigating this.

You need to use the E2E_PULL_IF_NOT_PRESENT=true so that your test cluster doesn't try to pull that (local) image:

E2E_PULL_IF_NOT_PRESENT=true make e2e-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

5 participants