caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00

2.6 KiB

Test Running Strategy for Claude Code

Critical Rules

  1. ALWAYS use ./scripts/test.sh instead of go test directly

    • It automatically skips broken tests from .test-skip
    • Uses appropriate timeouts (3m default)
    • Consistent with human developers and CI/CD
  2. Use -run to target specific tests when developing features

    # Good: When working on feature X
    ./scripts/test.sh -run TestFeatureX ./cmd/bd/...
    
    # Avoid: Running full suite unnecessarily
    ./scripts/test.sh ./...
    
  3. Understand the bottleneck: COMPILATION not EXECUTION

    • 180s compilation time vs 3.8s actual test execution (cmd/bd)
    • Running subset of tests doesn't save much time (still recompiles)
    • But use -run anyway to avoid seeing unrelated failures

Common Commands

# Full test suite (what 'make test' runs)
./scripts/test.sh

# Test specific package
./scripts/test.sh ./cmd/bd/...
./scripts/test.sh ./internal/storage/sqlite/...

# Test specific feature
./scripts/test.sh -run TestCreate ./cmd/bd/...
./scripts/test.sh -run TestImport

# Verbose output (when debugging)
./scripts/test.sh -v -run TestSpecificTest

When Tests Fail

  1. Check if it's a known broken test:

    cat .test-skip
    
  2. If it's new, investigate:

    • Read the test failure message
    • Run with -v for more detail
    • Check if recent code changes broke it
  3. If unfixable now:

    • File GitHub issue with details
    • Add to .test-skip with issue reference
    • Document in commit message

Package Size Context

The cmd/bd package is LARGE:

  • 41,696 lines of code
  • 205 files (82 test files)
  • 313 individual tests
  • Compilation takes ~180 seconds

This is why:

  • Compilation is slow
  • Test script uses 3-minute timeout
  • Targeting specific tests is important

Environment Variables

Use these when needed:

# Custom timeout
TEST_TIMEOUT=5m ./scripts/test.sh

# Verbose by default
TEST_VERBOSE=1 ./scripts/test.sh

# Run pattern
TEST_RUN=TestSomething ./scripts/test.sh

Quick Reference

Task Command
Run all tests make test or ./scripts/test.sh
Test one package ./scripts/test.sh ./cmd/bd/...
Test one function ./scripts/test.sh -run TestName
Verbose output ./scripts/test.sh -v
Custom timeout ./scripts/test.sh -timeout 10m
Skip additional test ./scripts/test.sh -skip TestFoo

Remember

  • The test script is in .gitignore path: scripts/test.sh
  • Skip list is in repo root: .test-skip
  • Full documentation: docs/TESTING.md
  • Current broken tests: See GH issues #355, #356