testing

testing is a cursor rule for Cursor from julien777z/agent-sync-action. It costs 0 tokens per session (3,739 once invoked), scanned B, original, MIT.

A project-specific rule file about testing. The available information does not describe the testing requirements inside it.

In plain words
What is it for?
It is for applying the project's testing rules during development.
Why use it?
It may define how tests should be written or run, but there is not enough information to say which testing problem it solves.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for applying the project's testing rules during development.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/julien777z/agent-sync-action/testing
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.

Clone the repo
git clone --depth 1 https://github.com/julien777z/agent-sync-action

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing

README.md
[![agentmods](https://agentmods.dev/badge/rules/julien777z/agent-sync-action/testing/github.svg)](https://agentmods.dev/rules/julien777z/agent-sync-action/testing)
Your own site
<a href="https://agentmods.dev/rules/julien777z/agent-sync-action/testing"><img src="https://agentmods.dev/badge/rules/julien777z/agent-sync-action/testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing

Your own site · 80×15
<a href="https://agentmods.dev/rules/julien777z/agent-sync-action/testing"><img src="https://agentmods.dev/badge/rules/julien777z/agent-sync-action/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,739 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.03739
Opus 5.5 $0.00000 $0.01496
Sonnet 5.5 $0.00000 $0.00748
Haiku 4.5 $0.00000 $0.00374

Measured 5d ago against content hash 1a4ce7751418, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

testing scanned grade B with 1 finding 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 5d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo systemctl start docker 2>/dev/null \
.cursor/rules/testing.mdc · 253 lines

How it starts

The opening of the file, as written. The whole thing — 253 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Rules

Test Organization

  • Test directories should mirror the source code structure.

  • If the source has core/, models/, routes/, or services/, keep the corresponding unit/ and integration/ folders aligned with those boundaries.

  • Place tests next to the source subdomain they verify, not in a loosely related folder.

  • Name a test module for the single source file it covers, prefixed with test_. Drop generated revision or timestamp prefixes from migration test names and retain the descriptive remainder. Name tests that span a subsystem for that subsystem.

  • Proto conversion round-trip tests are unit tests. Keep tests of the serialization layer itself in a dedicated proto/ test folder; gateway, runtime, and servicer tests that merely consume proto messages stay beside their owning source subdomain.

  • Use pytest async tests (async def test_...).

  • Group tests in classes named TestXxx.

  • Use fixtures for setup (defined in conftest.py or fixture modules).

  • Register custom pytest markers in pyproject.toml under [tool.pytest.ini_options].markers instead of adding them dynamically in pytest_configure(...) inside conftest.py.

  • Add a single-line docstring to every test class and test function.

  • Test docstrings must start with Test that ... (example: """Test that when no credentials are provided an exception is raised""").

  • Do not include numeric HTTP status codes in test function names; use semantic status names instead (for example, bad_request, not_found, forbidden).

  • Keep ALL imports at the top of test files.

  • Never import inside test functions or methods.

Fixtures and Test Data

  • Use clearly synthetic data that is unique to each test or parametrized case unless an exact protocol or catalog literal is the contract under test; never paste exact user-provided examples into tests, and preserve only the shape or edge case being verified when inventing replacements.
  • Define test helper functions at module level.
  • Keep helper docstrings to a single line.
  • Use Polyfactory for structured Pydantic and SQLAlchemy test data. Define concrete ModelFactory or SQLAlchemyFactory classes in the nearest shared factories.py, set __model__, provide deterministic domain defaults, and call .build(**overrides) directly from tests.
  • Let Polyfactory generate incidental valid values. Express domain constraints and cross-field relationships without replacing its generation with a large manual build() implementation.
  • Do not wrap Polyfactory classes in callable pytest fixtures solely for dependency injection, and do not use Protocol to describe them.
  • Use pytest factory fixtures for setup or construction that Polyfactory does not cover, including persisted flows, filesystem materialization, dependency lifecycles, and multi-object scenarios. Put reusable pytest builders in the nearest shared conftest.py, not in test modules.
  • Keep pytest factory names domain-focused. Name ORM persistence fixtures for their action, such as create_order or create_customer; never use an *_orm_factory suffix or encode persistence mechanics in the name.
  • Use explicit shared materialization helpers for filesystem and other I/O artifacts; accept typed factory-built models and explicit target paths.
  • Module-level helpers are allowed only for trivial, non-construction utilities scoped to one file (predicates, small formatters, to_comparable_string-style assertion adapters). When in doubt, move it to conftest.py.

Read the full file on GitHub · 253 lines

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. 5d ago Changed · +252 lines · -7 tokens per session scan A → B 1a4ce7751418
  2. 2mo ago First seen · 1 lines · 7 tokens per session scan A cb9e651e9890

Subscribe to this mod's changes

testing is a cursor rule published in the GitHub repository julien777z/agent-sync-action (9 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,739 tokens. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.