03-testing

A set of testing and continuous-integration rules for a Rust and Python WebView project. It defines where tests go, which testing tools to use, what behavior and performance to check, and how CI builds are run.

In plain words
What is it for?
Use it to organize Rust and Python tests, test public APIs and complete workflows, run smoke and stability checks, measure performance, and configure Windows CI builds.
Why use it?
It provides a shared testing structure so important workflows, stability cases, and resource limits are checked consistently.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/loonghao/auroraview/03-testing
Clone the repo
git clone --depth 1 https://github.com/loonghao/auroraview
Per session 478 This file is loaded in full into every session.
When invoked 478 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00478 $0.00478
Opus 5 $0.00239 $0.00239
Sonnet 5 $0.00096 $0.00096
Haiku 4.5 $0.00048 $0.00048

Measured 2d ago against content hash 561bcd757ab4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

03-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.codebuddy/rules/03-testing.mdc · 42 lines

What it actually says

测试与 CI

测试框架与组织策略

Rust 测试框架

  • 集成测试:独立管理在 tests/ 目录

    • 测试公共 API 和完整工作流
    • 使用 rstest 框架提供 fixture 和参数化测试能力
    • 位置:tests/*.rs
    • 运行:cargo test --test '*' --features "test-helpers"
  • 测试框架依赖(dev-dependencies):

    • rstest - Fixture-based 测试框架,提供类似 pytest 的 fixture 功能
    • test-case - 表驱动测试
    • proptest - 属性测试
    • mockall - Mock 框架
    • serial_test - 串行测试执行
    • criterion - 性能基准测试
  • 每个crate测试:

    • 避免把单元测试内联到代码中
    • 独立放到每个crate的 tests/ 目录中,使用rstest框架来测试

Python 测试框架

  • 使用 pytest 作为主测试框架
  • 位置:tests/*.py
  • 运行:pytest tests/

测试覆盖范围

  • 冒烟:创建/显示/导航/resize/焦点 与 JS 消息收发
  • 稳定性:睡眠/显示器切换/远程桌面 恢复;多实例并存
  • 性能:首次可见 < 300ms、FPS≥60、空闲 CPU≤5%、内存增量≤200MB

CI/CD 配置

  • Windows 构建矩阵(cp39–cp312 x64),签名与 WebView2 Runtime 检测提示
  • Rust 集成测试在 CI 中使用 test-helpers feature 运行
  • 使用 just 命令统一本地开发和 CI 环境
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 42 lines · 478 tokens per session scan A 561bcd757ab4

Subscribe to this mod's changes

03-testing is a cursor rule published in the GitHub repository loonghao/auroraview (44 stars, last pushed 1mo ago), licensed MIT. It adds 478 tokens to every session, about $0.0024 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.