用户可快速开展性能与集成测试。该项目基于 pytest 构建测试用例,使用 Playwright 模拟前端操作,通过 kubernetes-client python 管理后端资源,支持网络与资源监控及测试结果结构化输出。【此简介由AI生成】
| Files | Last commit | Last update |
|---|---|---|
| 1 year ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 6 months ago | ||
| 5 months ago | ||
| 1 year ago | ||
| 5 months ago | ||
| 5 months ago |
e2e-auto-test
Repository Overview
This repository consolidates the end-to-end and automated testing capabilities for openFuyao, primarily including:
e2e/: Backend / cluster-side tests built on Go, Ginkgo v2, Gomega, and Kubernetes client-go (covering installation, console API, online-offline colocation, NUMA, InferNex, multi-cluster, system-level integration, etc.).e2e-frontend/: UI automation tests for the management plane and guided installation interface, built on Playwright with TypeScript / JavaScript.
Repository SIG: sig-qa
Project Structure
e2e-auto-test/
├── e2e/ # Go: Ginkgo tests & framework (k8s, helm, executor, env, etc.)
├── e2e-frontend/ # Playwright: frontend test cases & playwright.config.ts
├── docs/ # Development notes (e.g., pytest/Playwright concepts & historical integration test guides)
├── .gitignore
├── LICENSE
└── README-en.md
e2e/ (Go)
Covers feature-level backend integration tests and system-level integration tests for openFuyao, written in Golang + Ginkgo. Tests are organized into directories by feature, with shared capabilities provided in framework/ (e.g., framework/env for resolving and loading e2e/.env from the repository root).
Sample Directory Structure
e2e/
├── framework/ # Shared test framework (k8s control, env management, utilities, etc.)
├── colocation/ # Online-offline colocation test cases
| ├── system-integration/ # Colocation system-level integration tests
├── numa-affinity/ # NUMA affinity test cases
| ├── system-integration/ # NUMA affinity system-level integration tests
├── ...
├── .env.template # Environment variable template
├── go.mod
├── go.sum
└── README-en.md
Notes:
- Each feature directory (e.g.,
colocation/,numa-affinity/, etc.) typically contains a_suite_test.gotest entry file and_testtest case files. The former includes setup and teardown operations for the current feature's tests, while the latter provides the code implementation for all test cases. Utility functions and resource template files are also provided. - Some feature directories include a standalone
system-integrationsubdirectory for system-level integration test cases specific to that feature. framework/provides a unified K8s client, Helm management, environment variable loading, and common utilities for all test cases, avoiding redundant development.- Each feature directory includes a
README-en.mdwith configuration details and test case onboarding guidelines for that feature.
For more detailed directory structure, test case design, and environment variable descriptions, refer to the README-en.md or comments within each feature subdirectory.
e2e-frontend/ (Playwright)
Covers feature-level frontend integration tests for openFuyao, implemented in JavaScript/TypeScript + Playwright. Tests are organized into directories by feature and managed via testMatch / projects in playwright.config.ts.
Sample Directory Structure
e2e-frontend/
├── auth/ # Authentication, authorization & RBAC tests
├── colocation/ # Online-offline colocation tests
| ├── test-xxx.spec.ts
| ├── colocation.setup.ts # Colocation setup
| └── colocation.setup.ts # Colocation teardown
├── ...
├── utils/ # Cross-module shared utility functions
├── global.setup.ts # Global setup
├── global.teardown.ts # Global teardown
├── .env.test.template # Environment variable template (copy to .env.test)
├── playwright.config.ts # Playwright & projects configuration
├── package.json
└── tsconfig.json
- Test cases under each feature directory should be named with
.spec.tsor.spec.jsto align with thetestMatchpatterns inplaywright.config.ts. utils/contains cross-feature reusable TypeScript utilities; individual feature directories may also include their ownutils/,constants.ts, etc.- Copy
.env.test.templateto.env.testand fill in values as needed. For specific fields and submodule instructions, see e2e-frontend/README-en.md.
Running Tests
e2e (Go / Ginkgo)
-
Install Ginkgo.
go install github.com/onsi/ginkgo/v2/ginkgo@latestAlternatively, refer to the Ginkgo installation guide.
-
Environment variables: Copy
e2e/.env.templatetoe2e/.envand fill in values according to the template and each feature's README-en (framework/envloads the specified file from thee2eroot directory, e.g.,.env). -
Dependencies:
cd e2e go mod download -
Execution examples (from the
e2edirectory):# Example: Run all Ginkgo Suites under the colocation package go test ./colocation -v # Example: Run a specific subdirectory only go test ./numa-affinity -vIf the Ginkgo CLI is installed, you can also use the
ginkgocommand to filter test cases. For example:# Example: Run all suites under the colocation package ginkgo -v ./colocation # Example: Run only test cases with "MyTest" in the title ginkgo -v --focus="MyTest" ./colocation # Example: Skip system-level integration tests under colocation ginkgo -v --skip-package="system-integration" ./colocation
e2e-frontend (Playwright)
-
Navigate to the directory and install dependencies and browsers (Chromium by default):
cd e2e-frontend npm install npx playwright install chromium -
Copy
e2e-frontend/.env.test.templatetoe2e-frontend/.env.testand fill in values according to the comments and e2e-frontend/README-en.md (configuration is loaded viadotenvinplaywright.config.ts). -
Run:
npm run test # Run all matching test cases from the command line npm run test:ui # UI modeFor VS Code, install the Playwright Test for VSCode extension to run and debug tests graphically. See e2e-frontend/README-en.md for details.
Introduction
用户可快速开展性能与集成测试。该项目基于 pytest 构建测试用例,使用 Playwright 模拟前端操作,通过 kubernetes-client python 管理后端资源,支持网络与资源监控及测试结果结构化输出。【此简介由AI生成】
Customize your domain