Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions wiki/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Read this file before exploring raw sources.
## Workflows

- [Docs and API Updates](./workflows/docs-and-api-updates.md) - How to handle changes that affect user-facing docs or durable project understanding.
- [Test Infrastructure](./workflows/test-infrastructure.md) - Local external services and optional CI benchmark report tooling.

## Decisions

Expand Down
6 changes: 6 additions & 0 deletions wiki/log.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Wiki Log

## [2026-05-04] workflow | record local test infrastructure

- sources touched: `README.md`, `benchmark/ci-test/README.md`, `scripts/dev-services.js`, `scripts/ci-test-benchmark.js`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This entry lists several files under "sources touched", but according to the pull request description and the diff, no runtime code or configuration files were modified in this change. To maintain an accurate log, this line should be updated or removed.

Suggested change
- sources touched: `README.md`, `benchmark/ci-test/README.md`, `scripts/dev-services.js`, `scripts/ci-test-benchmark.js`
- sources touched: none

- pages updated: `wiki/index.md`, `wiki/log.md`, `wiki/workflows/test-infrastructure.md`
- note: Added a durable workflow page for local MySQL/Redis service helpers and optional CI benchmark report generation.

## [2026-05-03] package | record egg bundler runtime path mapping

- sources touched: `tools/egg-bundler/src/lib/EntryGenerator.ts`, `tools/egg-bundler/docs/output-structure.md`
Expand Down
46 changes: 46 additions & 0 deletions wiki/workflows/test-infrastructure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Test Infrastructure
type: workflow
summary: Local services and CI benchmark tooling used to reproduce and measure test behavior.
source_files:
- README.md
- benchmark/ci-test/README.md
- package.json
- scripts/dev-services.js
- scripts/ci-test-benchmark.js
updated_at: 2026-05-04
status: active
---

# Test Infrastructure

Egg's repository-level test tooling includes helpers for local external services
and optional CI benchmark reports.

## Local External Services

`utoo run dev:services:start` starts the Docker Compose stack declared in
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The command utoo is used here, but ut is used later in the same file (line 37) and throughout the package.json scripts. For consistency and to align with the recommended alias mentioned in benchmark/ci-test/README.md, please use ut.

Suggested change
`utoo run dev:services:start` starts the Docker Compose stack declared in
`ut run dev:services:start` starts the Docker Compose stack declared in

`dev-services.compose.yml`. It provides MySQL 8 and Redis 7 on the CI-aligned
default host ports:

- MySQL: `127.0.0.1:3306`
- Redis: `127.0.0.1:6379`

The helper creates the MySQL databases used by DAL, ORM, Redis, session, and
cnpmcore-related fixtures. `dev:services:status`, `dev:services:stop`, and
`dev:services:reset` wrap the corresponding lifecycle actions. Port and image
overrides exist for compatibility checks, but the full local test path still
expects the default host ports because several fixtures hard-code them.

## CI Test Benchmark

`ut run benchmark:ci-test` runs `scripts/ci-test-benchmark.js`, which executes a
Vitest command and writes:

- `report.md`
- `report.json`
- `vitest-results.json`

The default output directory is `benchmark/ci-test/<timestamp>`. The harness is
for explicit measurement runs only; it does not change required checks or CI
gate semantics. Use `--output-dir` when a deterministic artifact path is needed.
Loading