Skip to content

test: clean integration fixtures and report failures as they happen - #9

Merged
mialbu merged 4 commits into
mainfrom
agent/clean-test-output-e32c
Oct 27, 2026
Merged

mialbu merged 4 commits into
mainfrom
agent/clean-test-output-e32c

Conversation

@mialbu

@mialbu mialbu commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

npm run test:integration was leaving a full node_modules tree for every generated chain fixture under gitignored test-output/. That is the ~17GB, not an npm or Vitest cache that grows on every identical re-run.

Each chain file installs dependencies for its A2A, streaming, and MCP projects, and x402 chains install one more. Twelve chains is about 43 installs of agent0-sdk and the rest of a generated project. Re-running replaces those same directory names, so the folder stays at the size of one full run instead of doubling. It never shrinks, because cleanupTestOutput() existed and was commented out. A renamed fixture would also be left behind forever.

This change:

  • Deletes each installed project when its suite finishes, after stopping the server.
  • Clears test-output/ at the start and end of every Vitest run, so a killed run cannot pile up on the next one.
  • Keeps the directory when KEEP_TEST_OUTPUT=1.

The fast suite (npm test, 113 tests) passes. The next integration run on a machine that still has the old tree will spend time deleting it at startup, then keep only one install at a time.

Test plan

  • npm test
  • npm run test:integration on a machine where the disk cost is acceptable (installs every chain fixture, then deletes each one)
  • KEEP_TEST_OUTPUT=1 npm test leaves test-output/ in place

Summary

npm run test:integration was leaving a full node_modules tree for every generated chain fixture under gitignored test-output/. That is the ~17GB, not an npm or Vitest cache that grows on every identical re-run.

Each chain file installs dependencies for its A2A, streaming, and MCP projects, and x402 chains install one more. Twelve chains is about 43 installs of agent0-sdk and the rest of a generated project. Re-running replaces those same directory names, so the folder stays at the size of one full run instead of doubling. It never shrinks, because cleanupTestOutput() existed and was commented out. A renamed fixture would also be left behind forever.

This change:

  • Deletes each installed project when its suite finishes, after stopping the server.
  • Clears test-output/ at the start and end of every Vitest run, so a killed run cannot pile up on the next one.
  • Keeps the directory when KEEP_TEST_OUTPUT=1.

The fast suite (npm test, 113 tests) passes. The next integration run on a machine that still has the old tree will spend time deleting it at startup, then keep only one install at a time.

Integration failures

The same integration run then failed in four places:

  • SKALE Base and SKALE Base Sepolia now assert the chain's own x402Network (eip155:1187947933 and eip155:324705682). The second shared regex only accepted Base, Polygon, and Ethereum Sepolia.
  • Server readiness starts at port 20000, keeps probing for 10 seconds after the listen banner, and records the last HTTP status. stop() kills the detached process group, so the tsx grandchild cannot keep the port after the suite deletes the project.
  • Ethereum Sepolia (4mica) no longer boots the live payment server. @4mica/x402@0.1.0 has no paymentFlows, so current @x402/core throws during route validation. https://x402.4mica.xyz/supported lists eip155:11155111 only as x402 v1, and core requires v2. Dependency, middleware, and network checks still run. The live 402 and paid-request cases are skipped for 4mica.

Test plan

  • npm test
  • npx vitest run --config vitest.integration.config.ts tests/chains/eth-sepolia.test.ts -t "x402 Payments" (4 passed, 23 skipped)
  • npm run test:integration on a machine where the disk cost is acceptable (installs every chain fixture, then deletes each one)
  • KEEP_TEST_OUTPUT=1 npm test leaves test-output/ in place

Integration tests install a full node_modules for every chain fixture and
the teardown that removed test-output/ was commented out, so one run left
about 17GB on disk. Remove each installed project when its suite finishes,
and clear test-output/ at the start and end of a Vitest run.
SKALE projects advertise their own CAIP-2 id, so assert each chain's
configured x402Network. Readiness starts at port 20000, keeps probing
after the listen banner, and stop() kills the process group.

Skip booting the 4mica server. Its scheme has no paymentFlows, and the
facilitator advertises Ethereum Sepolia only as x402 v1. Static checks
still run.
@cursor cursor Bot changed the title test: delete generated projects after each run test: clean generated output and fix integration failures Oct 27, 2026
The default reporter only prints the stack after every file finishes.
A long integration run shows a failed count in the live footer and
leaves out the file name and the error.
KEEP_TEST_OUTPUT=1 returned before the path check, so removing the
output root or a path outside it succeeded instead of throwing.
@mialbu mialbu changed the title test: clean generated output and fix integration failures test: clean integration fixtures and report failures as they happen Oct 27, 2026
@mialbu
mialbu merged commit cc4da5e into main Oct 27, 2026
1 check passed
@mialbu
mialbu deleted the agent/clean-test-output-e32c branch October 27, 2026 14:47
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