Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Jan 18, 2026

Summary

This PR sets up comprehensive test infrastructure for both JavaScript and Rust implementations as requested in issue #23.

JavaScript Changes

  • Vitest Configuration: Added vitest.config.js and vitest.integration.config.js for coverage reporting alongside existing test-anywhere for multi-runtime support
  • Test Fixtures (js/tests/fixtures/):
    • sample-links.js: Sample data including simple links, nested links, BigInt links, queue items
    • generateSequentialLinks() and generateRandomLinks() helper functions
  • Test Helpers (js/tests/helpers/):
    • test-utils.js: Utilities like createTestStore(), createPopulatedStore(), retry(), measureTime(), runBenchmark()
    • mock-backend.js: Mock implementations with configurable latency and failure injection
  • Integration Setup: tests/integration/setup.js with resource cleanup tracking
  • CI Updates: Added coverage job that runs Vitest and uploads coverage artifacts

Rust Changes

  • Criterion Benchmarks (rust/benches/):
    • memory_bench.rs: Benchmarks for MemoryLinkStore (create, get, exists, find, count, update, delete, clear)
    • queue_bench.rs: Benchmarks for MemoryQueue (enqueue, dequeue, peek, depth, roundtrip, bulk operations)
  • Test Fixtures (rust/tests/fixtures/mod.rs):
    • Sample links and link patterns
    • Bulk data generators (generate_sequential_links(), generate_random_links())
    • Store fixtures for consistent test setup
    • Assertion helpers
  • CI Updates: Added bench job that compiles and runs Criterion benchmarks with artifact upload

Test Results

  • ✅ JavaScript: 469 tests passing (Node.js, Bun, Deno)
  • ✅ Rust: 360 tests passing (Ubuntu, macOS, Windows)
  • ✅ Rust benchmarks compile and run successfully
  • ✅ All CI checks pass

New Scripts

JavaScript:

  • npm run test:coverage - Run tests with Vitest coverage
  • npm run test:integration - Run integration tests
  • npm run test:watch - Watch mode for development

Rust:

  • cargo bench --bench memory_bench - Run memory store benchmarks
  • cargo bench --bench queue_bench - Run queue benchmarks

Test Plan

  • Run existing JavaScript tests (469 pass)
  • Run existing Rust tests (360 pass)
  • Verify Rust benchmarks compile
  • CI runs coverage job and uploads artifacts
  • CI runs benchmark job and uploads results

Fixes #23


🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #23
@konard konard self-assigned this Jan 18, 2026
JavaScript:
- Add Vitest configuration alongside test-anywhere for coverage reporting
- Create test fixtures with sample links, nested structures, and generators
- Add test helper utilities (createTestStore, retry, measureTime, etc.)
- Add mock backend implementations for isolated testing
- Create integration test setup with resource cleanup
- Update CI workflow to run coverage and upload artifacts

Rust:
- Add Criterion benchmark infrastructure for performance testing
- Create memory_bench.rs for MemoryLinkStore benchmarks
- Create queue_bench.rs for MemoryQueue benchmarks
- Add test fixtures module with sample data generators
- Update CI workflow to compile and run benchmarks

Resolves #23

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] [Cross-cutting] Set up comprehensive test infrastructure [Cross-cutting] Set up comprehensive test infrastructure Jan 18, 2026
konard and others added 4 commits January 18, 2026 22:18
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use backticks for type name in doc comment
- Add explicit u64 type for array elements to avoid sign loss
- Add semicolon after rt.block_on() call

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review January 18, 2026 21:34
@konard
Copy link
Member Author

konard commented Jan 18, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $12.063579 USD
  • Calculated by Anthropic: $10.335181 USD
  • Difference: $-1.728398 (-14.33%)
    📎 Log file uploaded as Gist (1737KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

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.

[Cross-cutting] Set up comprehensive test infrastructure

2 participants