Skip to content

Expand Test Coverage #9

@Kinflou

Description

@Kinflou

Expand Test Coverage

Priority

P2 (Medium) - Quality assurance

Labels

  • testing
  • quality
  • P2

Estimated Effort

Ongoing (2-3 weeks initially)

Description

Add comprehensive test suite to ensure correctness and prevent regressions. Current test coverage is limited.

Current State

Location: core/tests/

Some tests exist for:

  • schema/ - Schema parsing tests
  • package_config/ - Package config tests
  • autodoc/ - Autodoc tests

Coverage is unknown and likely insufficient.

Acceptance Criteria

  • Unit tests for all parsers (pest/chosen parser)
  • Integration tests for full compilation pipeline
  • Regression tests for all fixed bugs
  • Property-based testing (fuzzing) for parser
  • Performance benchmarks for critical paths
  • Test coverage >70% (measured with cargo tarpaulin or similar)
  • CI/CD running tests on every PR

Tasks

Unit Tests

  • Parser tests (all schema features)
  • IR compilation tests (each AST node type)
  • CAS storage tests (blob, tree, commit)
  • Version diffing tests
  • Package resolution tests
  • Error message tests

Integration Tests

  • End-to-end schema compilation
  • Multi-file imports
  • Package with dependencies
  • Version bumping scenarios
  • Code generation pipeline

Property-Based Testing

  • Fuzz parser with random .ids files
  • Fuzz CAS with random data
  • Invariant testing (parse → compile → freeze → unfreeze should be identity)

Performance Tests

  • Parser benchmarks (small, medium, large schemas)
  • Compilation benchmarks
  • CAS lookup benchmarks
  • Memory usage profiling

CI/CD Setup

  • GitHub Actions workflow
  • Run tests on Linux, macOS, Windows
  • Check test coverage
  • Enforce minimum coverage threshold
  • Run benchmarks and track performance

Tools

  • cargo test - Standard test runner
  • cargo bench - Benchmarking
  • cargo tarpaulin - Code coverage
  • cargo fuzz - Fuzz testing
  • proptest - Property-based testing

Dependencies

  • Should track all P0 and P1 tasks (tests for each feature)

Blocks

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2 - MediumqualityCode qualitytestingTesting

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions