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

E2E test guide #44

Open
YaoZengzeng opened this issue Jun 27, 2024 · 4 comments
Open

E2E test guide #44

YaoZengzeng opened this issue Jun 27, 2024 · 4 comments

Comments

@YaoZengzeng
Copy link
Member

Add developer about how to run E2E test guide in local dev environment.

About how to write the doc, you can refer UT's user guide: #41

And the E2E test framework design can refer here: https://github.com/kmesh-net/kmesh/blob/main/docs/proposal/e2e.md

You can try to try running the tests locally yourself, extracting some of the content in the proposal, such as the use of the command line flags, and extending it appropriately. So as to wirte a doc that can make it easy for other developers to get started.

@noobwei

@hzxuzhonghu
Copy link
Member

For developers, they would also want to see a doc about how to developing a new case for e2e

@noobwei
Copy link
Contributor

noobwei commented Jul 1, 2024

E2E test guide

End-to-End (E2E) testing is a crucial component in modern software development, designed to simulate user interactions across the entire application to ensure all components and integrations function together seamlessly. By incorporating E2E testing, we can verify that changes in code do not disrupt existing functionalities, maintaining the integrity and reliability of the system even as it evolves.

Prerequisites

The Go version in go.mod is 1.22.0

The following components will be installed while using the shell

  • Kind
  • Helm
  • istioctl

Components that need to be installed by the user

Usage

To run the E2E tests, execute the run_test.sh script located in the ./test/e2e directory. This script automates the following tasks:

  1. Installing dependencies: Tools like Kind, Helm, and Istioctl are installed.
  2. Deploying a local image registry: A Docker container functions as the local image registry.
  3. Building and pushing the Kmesh image: The custom Kmesh Docker image is built and pushed to the local registry.
  4. Deploying Kubernetes cluster, Istio, and Kmesh: These components are necessary for the tests and are set up in this step.
  5. Deploying test applications and executing the E2E tests.

Command Line Flags

When testing locally, you may want to skip some setup steps to save time, especially after the initial setup is complete. The following flags are available to customize the test execution:

  • --skip-install-dep: Skips the installation of dependencies.
  • --skip-build: Skips building and pushing the Kmesh image to the local image registry.
  • --skip-setup: Skips deploying the Kubernetes cluster, Istio, and Kmesh.
  • --only-run-tests: Skips all other steps and focuses only on deploying test applications and running E2E tests.

Example Commands

  • Full Test Run (First Time):

    sudo ./test/e2e/run_test.sh

    Use this command for the initial setup and test run to ensure everything is configured correctly.

  • Subsequent Test Runs (Skipping Setup):

    sudo ./test/e2e/run_test.sh --only-run-tests

How to add test case

TODO

@YaoZengzeng
Copy link
Member Author

@noobwei great job! And You should make a Pull Request, put the above content in the corresponding directory.

@hzxuzhonghu
Copy link
Member

https://kmesh.net/en/docs/developer/e2e-guide/#how-to-add-test-case We are missing how to develope test case.
And also better to provide more guide on run test case

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

No branches or pull requests

3 participants