Skip to content

docs(skill): backend test authoring rules (call the test fn + sandbox limits)#5

Closed
fyZhang66 wants to merge 2 commits into
mainfrom
docs/backend-test-authoring-rules
Closed

docs(skill): backend test authoring rules (call the test fn + sandbox limits)#5
fyZhang66 wants to merge 2 commits into
mainfrom
docs/backend-test-authoring-rules

Conversation

@fyZhang66

Copy link
Copy Markdown

Why

Debugging real CLI backend tests surfaced two authoring gaps that produced misleading results:

  1. Defined-but-uncalled tests silently passed. The runner executes --code-file top-to-bottom (not pytest), so a def test_*(): assert … that's never called never runs its assertions → green regardless.
  2. Imports outside the sandbox fail to run. The execution environment only has stdlib + requests + pytest + numpy + scipy. Tests that import the project's own source modules or other packages (torch, pandas, local app modules) die with ModuleNotFoundError.

Change (skill assets only — markdown)

  • skills/testsprite-verify.skill.md: backend example now ends with a module-level call to the test fn, plus a new "Execution environment (backend)" note (supported package set + "test the API over HTTP with requests, don't import app source / unavailable packages").
  • skills/testsprite-verify.codex.md: two terse mirroring bullets.

No code/behavior change.

Related

The execution image is gaining numpy/scipy so the "supported set" above is accurate.

🤖 Generated with Claude Code

fyZhang66 and others added 2 commits June 22, 2026 19:41
…x limits

Two authoring gaps surfaced while debugging CLI backend tests that silently passed:

1. The runner executes --code-file top-to-bottom (not pytest), so a defined-but-
   uncalled test_* function never runs its assertions. Tell agents to call their
   test function(s) at the end of the file.
2. The execution sandbox only has stdlib + requests + pytest + numpy + scipy.
   Tests that import the project's own source modules or other packages (torch,
   pandas, local app modules) fail to run. Tell agents to test the API over HTTP
   with requests and not import app internals / unavailable packages.

Applies to testsprite-verify.skill.md (full note) + testsprite-verify.codex.md (bullets).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Test Coverage Report

Metric Coverage
Lines 87.55%
Statements 87.55%
Functions 80.42%
Branches 85.39%

@fyZhang66 fyZhang66 requested a review from zeshi-du June 23, 2026 02:46
@fyZhang66

Copy link
Copy Markdown
Author

Closing — this backend-test authoring guidance belongs in the internal testsprite-cli dev lineage (src/assets/agent-skill/gundam.*), not the public repo's skills/.

@fyZhang66 fyZhang66 closed this Jun 23, 2026
@fyZhang66 fyZhang66 deleted the docs/backend-test-authoring-rules branch June 23, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant