Skip to content

[apiserver] Make local-e2e-test hermetic #3513

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

troychiu
Copy link
Contributor

@troychiu troychiu commented Apr 30, 2025

Why are these changes needed?

Make local-e2e-test hermetic by cleaning cluster first.

Related issue number

Closes #3368

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
@troychiu troychiu changed the title add clean-kuberay-resources to api-server makefile [apiserver] Add clean-kuberay-resources to api-server makefile Apr 30, 2025
Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
@kevin85421
Copy link
Member

cc @rueian

@rueian
Copy link
Contributor

rueian commented Apr 30, 2025

LGTM.

@dentiny
Copy link
Contributor

dentiny commented Apr 30, 2025

I had some discussion with @troychiu offline, haven't fully decided the plan

@troychiu
Copy link
Contributor Author

tldr @dentiny suggest keep e2e-test only run go test, so maybe we should put clean-kuberay-resources to local-e2e-test. However, I have found that local-e2e-test won't work on my side if the cluster already exists.

@rueian
Copy link
Contributor

rueian commented Apr 30, 2025

If we are going to move the cleanup to local-e2e-test, can we just reuse clean-cluster?

@troychiu
Copy link
Contributor Author

I added it to e2e-test because I would like to run end-to-end test on a existing cluster so that I don't have to create a cluster every time. Wdyt?

@rueian
Copy link
Contributor

rueian commented Apr 30, 2025

I think both are ok.

@dentiny
Copy link
Contributor

dentiny commented May 1, 2025

I discussed a little with @troychiu yesterday, here's my personal opinion and thoughts:

  • There're two types of testing targets for now: end-to-end testing (local-e2e) and pure testing (e2e)
  • The former does env setup + cleanup + test, so hermeticity is a necessity, otherwise the test would fail
  • The later is only for test, as long as test itself succeeds and the test itself has no side effect, we could run any tests for any number of times
  • So my preference is to add the cleanup logic in local-e2e target

troychiu added 2 commits May 2, 2025 00:30
Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
Copy link
Contributor

@dentiny dentiny left a comment

Choose a reason for hiding this comment

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

Thank you!

echo "Kind cluster $(KIND_CLUSTER_NAME) already exists, please run 'make clean-cluster' to delete the cluster."; \
echo "Kind cluster $(KIND_CLUSTER_NAME) already exists, clean up kuberay resources and uninstall the apiserver."; \
$(MAKE) clean-kuberay-resources; \
$(MAKE) uninstall; \
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: do you think it's better to rename uninstall to something more clear, for example, uninstall-api-server?
My concern is, we have too many things to uninstall, for example, apiserver, crd, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just use make clean-cluster?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's even simpler.

troychiu added 3 commits May 2, 2025 11:10
Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
Signed-off-by: Troy Chiu <y.troychiu@gmail.com>
@troychiu troychiu requested review from rueian and dentiny May 2, 2025 18:11
@troychiu troychiu changed the title [apiserver] Add clean-kuberay-resources to api-server makefile [apiserver] Make local-e2e-test hermetic May 2, 2025
@kevin85421
Copy link
Member

@troychiu can you fix the conflicts? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Clear cluster before running end-to-end apiserver test
4 participants