Agent Skillsfastrepl/anarlog › axum-test-transport

axum-test-transport

GitHub

指导Axum服务测试策略,优先使用tower::oneshot进行无网络的状态码、路由及中间件验证,仅在WebSocket或端到端场景保留真实TcpListener服务器测试。

.agents/skills/axum-test-transport/SKILL.md fastrepl/anarlog

Trigger Scenarios

编写Axum服务单元测试 决定使用in-process还是real-server进行测试 优化现有测试启动方式

Install

npx skills add fastrepl/anarlog --skill axum-test-transport -g -y
More Options

Non-standard path

npx skills add https://github.com/fastrepl/anarlog/tree/main/.agents/skills/axum-test-transport -g -y

Use without installing

npx skills use fastrepl/anarlog@axum-test-transport

指定 Agent (Claude Code)

npx skills add fastrepl/anarlog --skill axum-test-transport -a claude-code -g -y

安装 repo 全部 skill

npx skills add fastrepl/anarlog --all -g -y

预览 repo 内 skill

npx skills add fastrepl/anarlog --list

SKILL.md

Frontmatter
{
    "name": "axum-test-transport",
    "metadata": {
        "internal": true
    },
    "description": "Choose between in-process `tower::ServiceExt::oneshot` tests and real `tokio::net::TcpListener` server tests for Axum services in this repository."
}

Use this skill when working on Axum tests that currently start a server or could be simplified.

Prefer oneshot when the test only verifies:

  • status codes
  • headers
  • JSON/body shape
  • route or middleware behavior
  • request handling without real network behavior

Use:

use tower::ServiceExt;

oneshot is available through tower::ServiceExt.

Keep a real TcpListener + axum::serve(...) when the test needs:

  • WebSocket upgrade/handshake behavior
  • real client behavior (reqwest, tokio_tungstenite, etc.) as the thing under test
  • transport/lifecycle concerns like bind/listen/shutdown
  • true end-to-end coverage over http:// or ws://

Repository guidance:

  • crates/transcribe-cactus/tests/batch.rs style tests are good oneshot candidates
  • crates/transcribe-cactus/tests/live.rs WebSocket tests should stay real-server
  • if several tests share the same in-process request setup, add a tiny local helper (for example request builder or response JSON parser)

After changes:

  • run pnpm exec dprint fmt
  • run the relevant Rust test compile/check command

Version History

  • 2d4c6b1 Current 2026-08-20 17:12

Same Skill Collection

.agents/skills/add-plugin/SKILL.md
.agents/skills/fix-ready-prs/SKILL.md
.agents/skills/migrate-to-sqlite/SKILL.md
.agents/skills/new-changelog/SKILL.md
.agents/skills/product-update-newsletter/SKILL.md
.agents/skills/qa-cli-mcp-api/SKILL.md
.agents/skills/qa-critical-ux/SKILL.md
.agents/skills/reactive-sqlite-ui/SKILL.md
.agents/skills/release-new-version/SKILL.md
.agents/skills/sqlite-schema-design/SKILL.md
.claude/skills/fix-ready-prs/SKILL.md
.claude/skills/product-update-newsletter/SKILL.md
.claude/skills/qa-critical-ux/SKILL.md
.claude/skills/release-new-version/SKILL.md
.cursor/skills/new-changelog/SKILL.md
.cursor/skills/qa-cli-mcp-api/SKILL.md
.cursor/skills/qa-critical-ux/SKILL.md
.cursor/skills/release-new-version/SKILL.md
agent-plugins/anarlog/skills/anarlog/SKILL.md
skills/anarlog/SKILL.md

Metadata

Files
0
Version
382d3cf
Hash
e52c93a7
Indexed
2026-08-20 17:12

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-29 23:35
浙ICP备14020137号-1 $お客様$