Skip to content

[TEST] #68: phraya plan CLI acceptance tests#103

Merged
crashfrog merged 1 commit into
mainfrom
worktree-agent-a8e8759ba65d449d4
May 31, 2026
Merged

[TEST] #68: phraya plan CLI acceptance tests#103
crashfrog merged 1 commit into
mainfrom
worktree-agent-a8e8759ba65d449d4

Conversation

@crashfrog
Copy link
Copy Markdown
Member

Summary

  • Add comprehensive integration tests for phraya plan CLI command
  • Tests cover all 4 use cases and error conditions
  • All tests failing as expected (RED phase) pending implementation

Test Coverage

Acceptance Criteria Tested

  • Parse command-line arguments (--inputs, --reference, --output)
  • Read FASTA/FASTQ input files
  • Compute k-mer sketches
  • Detect use cases (Case 2/3/4)
  • Compute k-mer uniqueness
  • Generate task lists
  • Write .phrayaplan files
  • Log detected use case
  • Error handling for invalid inputs
  • Multi-file input support

Test Filter Command

cargo test --test integration_test_plan -- --ignored

All 10 tests currently FAIL as expected (feature not implemented).

API Surface Assumed by Tests

The tests assume a phraya plan CLI command with the following signature:

phraya plan \
  --inputs <file> [--inputs <file> ...] \
  [--reference <ref-file>] \
  --output <plan.phrayaplan>

Behavior:

  • Reads sequence files (auto-detects FASTA/FASTQ, supports gzip)
  • Creates Sequence objects for all inputs
  • Computes minimizer sketches (k=21, w=11 default)
  • Detects use case based on input composition:
    • Case 2: --reference + --inputs (reads) -> ReadsWithRef
    • Case 3: --inputs with mix (contigs + reads), no --reference -> ContigsWithReads
    • Case 4: --inputs (contigs only), no --reference -> ContigsOnly
  • Computes k-mer uniqueness across all sequences
  • Generates task list (query_id, target_id pairs) per use case
  • Writes binary MessagePack + zstd PhrayaPlan to output file
  • Logs detected use case to stderr (e.g., "Detected Case 2: reads with reference")
  • Exits with code 0 on success, non-zero on error
  • Provides clear error messages on file I/O failures or missing arguments

Task List Generation:

  • Case 2: One task per read, target=reference (index 0)
  • Case 3: Tasks depend on centroid selection (not fully specified in test)
  • Case 4: All-vs-all tasks (M*(M-1)/2)

Generated files are validated by reading them back using phraya_io::plan::read_plan().

🤖 Generated with Claude Code

Add integration tests for phraya plan CLI covering:
- Case 2: reads + reference (main use case)
- Case 3: contigs + reads, no reference
- Case 4: contigs only
- Error handling and edge cases
- CLI argument parsing
- K-mer uniqueness computation
- Task list generation

All tests marked with #[ignore] and will fail until implementation.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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