Skip to content

[Cross-cutting] Set up comprehensive test infrastructure #23

@konard

Description

@konard

Summary

Set up comprehensive testing infrastructure for both JavaScript and Rust implementations, including unit tests, integration tests, and benchmarks.

Background

Following code-architecture-principles:

  • Testing & Correctness: Write deterministic core logic; validate inputs at boundaries

Requirements

Test Categories

Unit Tests

  • Test individual functions and methods in isolation
  • Mock external dependencies
  • 100% coverage target for core modules

Integration Tests

  • Test component interactions
  • Test with real backends (memory, link-cli)
  • Test client-server communication

End-to-End Tests

  • Full workflow tests
  • Multi-node scenarios
  • Failure recovery scenarios

Benchmark Tests

  • Throughput benchmarks (messages/second)
  • Latency benchmarks (p50, p99)
  • Memory usage profiling
  • Comparison with competitors (BullMQ, etc.)

JavaScript Test Setup

{
  "scripts": {
    "test": "vitest run",
    "test:watch": "vitest",
    "test:coverage": "vitest run --coverage",
    "test:integration": "vitest run --config vitest.integration.config.ts",
    "bench": "vitest bench"
  }
}

Rust Test Setup

[dev-dependencies]
tokio-test = "0.4"
criterion = "0.5"

[[bench]]
name = "queue_bench"
harness = false

CI Integration

  • Run tests on every PR
  • Coverage reporting
  • Benchmark comparison with main branch
  • Test across all runtimes (Node.js, Bun, Deno)

Deliverables

JavaScript

  1. Set up Vitest with coverage
  2. Unit test templates for each module
  3. Integration test setup with test fixtures
  4. Benchmark setup with Vitest bench
  5. CI workflow for tests

Rust

  1. Unit test organization
  2. Integration test setup
  3. Criterion benchmark setup
  4. CI workflow for tests

Shared

  1. Test fixtures (sample data)
  2. Mock implementations for backends
  3. Helper utilities for testing

Dependencies

  • None (can be done in parallel with feature development)

Can Be Worked On Independently

This issue can be worked on independently of feature development. Test templates can be created as placeholders.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions