backend-tests

A testing guide for Python API and data services in the Massing project, including how its self-contained test scripts and test runner work.

In plain words
What is it for?
Use it to run or add backend tests, isolate their environments, clean up database locks, or investigate CI test-gate failures.
Why use it?
It prevents common test-runner, environment, database-lock, encoding, and test-registration problems from causing misleading failures.

Skill for Claude CodeCodex

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 skills/ibuilder/massing/backend-tests
Any agent
npx skills add ibuilder/massing --skill backend-tests
Clone the repo
git clone --depth 1 https://github.com/ibuilder/massing

Made for: Claude Code, Codex.

Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 885 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00069 $0.00885
Opus 5 $0.00034 $0.00443
Sonnet 5 $0.00014 $0.00177
Haiku 4.5 $0.00007 $0.00089

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

Security

Grade C, and why

backend-tests scanned grade C 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 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **Local DB lock**: a killed test can leave `test_*.db` locked ("Device or resource busy"). Clean `rm -f ./test_<name>.db; rm -rf ./test_storage_<name> ./test_ifc_<name>` before re-running; if truly stuck, run a throwaw
.claude/skills/backend-tests/SKILL.md · 41 lines

How it starts

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

Massing backend tests

Standing directions for this repo: docs/roadmap-directions.md. Read those first.

There is no pytest. Tests are self-contained test_*.py scripts in services/api/ that spin up their own TestClient, assert, print a one-line summary, and exit non-zero on failure.

Run

cd services/api
PYTHONPATH="src;../data/src" ./.venv/Scripts/python.exe -X utf8 run_tests.py     # whole suite (~40 min)
PYTHONPATH="src;../data/src" ./.venv/Scripts/python.exe -X utf8 test_<name>.py    # one test

Use -X utf8 — some tests print /²/³ and crash on the default Windows cp1252 console (a false failure; CI uses utf-8).

The manifest guard — REGISTER NEW TESTS

run_tests.py has a hand-maintained TESTS list and a manifest_problems() guard that fails the whole run before any suite starts if the list and the test_*.py files on disk are not a 1:1 map. It enforces three rules:

  1. no duplicate registration — a name listed twice would run the suite twice, burning wall time;
  2. every registered name has a file — the runner used to silently drop missing entries, so a typo still printed "N/N suites passed";
  3. every file on disk is registered — a test nobody runs is worse than no test.

After adding test_foo.py, add "test_foo" to the TESTS list or CI fails before running anything. test_manifest.py asserts the live manifest is clean and drives each rule with a synthetic violation to prove the guard can still go red — keep those synthetic cases if you touch the guard.

Two test idioms

  • DB-backed API test: set os.environ["DATABASE_URL"], STORAGE_DIR, and (if it uploads a source IFC) IFC_DIR — all to ./test_*-prefixed local paths (gitignored). os.environ.pop("AEC_RBAC", None). Use TestClient(app) + X-User header. Upload a model via POST /projects/{pid}/source-ifc?publish=false.
  • Engine/IFC test: prepend ../data/src to sys.path, build a model with aec_data.massing.generate_blank_ifc + aec_data.edit.*, and assert on aec_data/aec_api engine functions directly (no DB needed).

Read the full file on GitHub · 41 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. 2d ago First seen · 41 lines · 69 tokens per session scan C 2b793eed5404

Subscribe to this mod's changes

backend-tests is a skill published in the GitHub repository ibuilder/massing (132 stars, last pushed 2d ago), licensed MIT. It adds 69 tokens to every session and 885 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

ara3d-sdk

Use when processing AEC/BIM 3D data in .NET 8 — mesh generation and transformation, SIMD-accelerated math, IFC/STEP/PLY to glTF/GLB/VIM conversion, plugin development. Ara3D-SDK: high-performance .NET 3D geometry and BIM library suite.

znlgis/opengis-skills · 70 tokens

elements

Use when generating building information models (BIM) programmatically in C#/.NET — wall, beam, column, floor creation, geometry kernel (BREP/CSG), glTF/IFC/JSON serialization, MEP systems, spatial grids. Hypar Elements: the smallest useful BIM — a cross-platform C# library for creating building elements without…

znlgis/opengis-skills · 81 tokens

tauri-impl-testing

Use when writing tests for Tauri 2 commands, mocking IPC calls, or setting up E2E test suites. Prevents untestable command handlers and stale mock state from missing clearMocks() between tests. Covers Rust unit testing, frontend IPC mocking with mockIPC/mockWindows, WebDriver E2E testing, and integration testing.…

OpenAEC-Foundation/OpenAEC-Workspace-Composer · 103 tokens

solid-impl-testing

Use when writing unit or integration tests for SolidJS components, signals, or stores. Prevents missing cleanup calls, incorrect async test patterns, and React Testing Library habits that break SolidJS tests. Covers @solidjs/testing-library render, screen queries, fireEvent, cleanup, async testing, renderHook…

OpenAEC-Foundation/OpenAEC-Workspace-Composer · 103 tokens

fy_layout

Use when doing construction site layout planning with the FeiYang LightCAD platform — fence, lawn, foundation pit, road, prefab house 2D/3D modeling. FYLayout: construction site layout secondary development plugin for LightCAD/LightBIM.

znlgis/opengis-skills · 56 tokens

xbim

Use when processing BIM/IFC data in .NET/C# — IFC reading/writing, model validation, quantity takeoff, geometry extraction. xBIM: .NET BIM/IFC toolkit for building information modeling workflows.

znlgis/opengis-skills · 49 tokens