Skip to content

test: increase test coverage overall - #49

Open
rschauner wants to merge 12 commits into
mainfrom
45-test-increase-test-coverage-overall
Open

test: increase test coverage overall#49
rschauner wants to merge 12 commits into
mainfrom
45-test-increase-test-coverage-overall

Conversation

@rschauner

Copy link
Copy Markdown
Member

This closes #45.

- create new test_helpers module to centralize file handling
- Introduce reusable test templates with `rstest_reuse`.
- Add new test cases to ensure CLI subcommands handle missing inputs correctly.
- Enhance subcommand coverage for `reformat-plate-reader-data`.
- Remove `#[ignore]` attribute for `test_blosum62_error_handling` as it is no longer needed.
- Limit `set_blosum62_to_err_for_test` function visibility to the current module by removing `pub(crate)`.
…remove internal API dependency

- Introduced `EnrichrAPITrait` to abstract API interactions.
- Removed internal `api` field from `Enrichment` and adjusted `run` method to accept `EnrichrAPITrait` implementations.
- Simplified `EnrichrAPI` initialization by passing `background` directly.

refactor(enrichment): extract gene list parsing into separate function

test: add tests for enrichment module
- Replaced `#[should_panic]` in `handle_command` tests with explicit error handling checks.
- Added validation for unsupported background file usage in `handle_command`.
- Introduced parameterized tests for `APIFailure::to_string` with `rstest`.
- Enhanced `test_enrichr_result_empty` with multithreaded async execution and result persistence checks.
…tions

- Introduced `create_dual_progress_bar` to handle progress bar creation for outer and inner loops.
- Extracted `calculate_single_chain_score` and `calculate_single_chain_background_score` for better modularity and reduced code duplication.
- Removed redundant `height` parameter by directly retrieving it from `groups.height()`.
- Optimized test coverage by parameterizing `test_downsample_vec_limits` with `rstest`.
- Added helper `get_f64_col_by_idx` to streamline test code for column value extraction.

test(tcr-align): enforce `cargo nextest run` for `test_blosum62_error_handling`

- Added an assertion to ensure the test runs only with `cargo nextest run` due to its reliance on per-test process isolation.
…onality

- Added assertions in `read_excel` tests to ensure non-empty dimensions (width and height).
- Introduced `test_read_excel_from_generic` for testing Excel file parsing with generic input.
…test`

- Added tests for `thread_parser` and `thread_default` with separate cases for `base_cmd` and `no_base_cmd` configurations.
- Refactored `num_cpu` logic to support test-specific overrides and ensure consistency in test environments.
- Updated `thread_parser` to utilize the new `num_cpu` function.
…angerTCR

chore: add missing empty line in gene list file
- Update `Cargo.lock`
- Added `temp_testdir` for improved test sandboxing.
- Adjusted Codecov config to include `target: auto` in project status checks.
@rschauner rschauner self-assigned this Aug 17, 2026
@rschauner rschauner linked an issue Aug 17, 2026 that may be closed by this pull request
3 tasks
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.92617% with 33 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/enrich/core.rs 84% 14 Missing ⚠️
src/tcr_align/dataframe.rs 88% 13 Missing ⚠️
src/enrich/api.rs 82% 3 Missing ⚠️
src/main.rs 70% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/aggregate/mod.rs 100% <100%> (+100%) ⬆️
src/enrich/mod.rs 78% <100%> (+78%) ⬆️
src/geo_submission/mod.rs 92% <100%> (+73%) ⬆️
src/geo_submission/test.rs 100% <ø> (ø)
src/io.rs 92% <100%> (+1%) ⬆️
src/plate_reader/core.rs 88% <100%> (+2%) ⬆️
src/tcr_align/align.rs 93% <100%> (+16%) ⬆️
src/test_helpers.rs 100% <100%> (ø)
src/enrich/api.rs 71% <82%> (+71%) ⬆️
src/main.rs 70% <70%> (+16%) ⬆️
... and 2 more

... and 3 files with indirect coverage changes

@rschauner
rschauner force-pushed the 45-test-increase-test-coverage-overall branch from d1a0b73 to 64a7d06 Compare August 17, 2026 20:02
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.

test: increase test coverage overall

1 participant