-
Notifications
You must be signed in to change notification settings - Fork 0
Unit tests #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit tests #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a comprehensive test suite with unit and integration tests for the DeepSearch pipeline validation project. The tests achieve approximately 81% code coverage and include CI/CD integration via GitHub Actions.
Key Changes
- Added 8 unit test files covering helper functions in project paths, DeepSearch processing, comparison processing, and component/GO term building
- Added 5 integration test files testing end-to-end workflows for DeepSearch processing, comparisons, report generation, heatmaps, and component matching
- Modified 4 source files (
match_components.py,extract_run_payloads.py,build_go_terms.py,build_component_mapping.py) to acceptargvparameter for testability - Configured pytest with coverage tracking in
pyproject.toml, added test dependencies inrequirements-dev.txt, and added Makefile targets - Set up GitHub Actions workflow for automated testing with coverage badge generation
- Removed unused
src/rename_runs.pyfile
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_project_paths.py | Tests path resolution with defaults and custom projects |
| tests/unit/test_process_deepsearch_helpers.py | Tests JSON extraction, signature computation, name similarity, and program similarity calculations |
| tests/unit/test_process_deepsearch_extract.py | Tests parsing of run markdown files with JSON payloads |
| tests/unit/test_process_comparisons_helpers.py | Tests GO term extraction, gene set ID parsing, program table parsing, and term normalization |
| tests/unit/test_generate_summary_figures.py | Tests plot generation for run consistency and GO coverage |
| tests/unit/test_extract_run_payloads.py | Tests citation extraction and full extraction workflow |
| tests/unit/test_build_go_terms.py | Tests GO term ID extraction from raw strings |
| tests/unit/test_build_component_mapping.py | Tests tokenization logic for removing suffixes like "-like" |
| tests/unit/init.py | Package marker for unit tests |
| tests/integration/test_process_deepsearch_main.py | Integration test for complete DeepSearch processing pipeline |
| tests/integration/test_process_comparisons_main.py | Integration test for comparison processing with S10 data |
| tests/integration/test_generate_reports_and_master.py | Integration test for report and master report generation |
| tests/integration/test_generate_heatmaps.py | Integration test for heatmap generation from program data |
| tests/integration/test_build_component_and_go_and_match.py | Integration test for component/GO term building and matching |
| tests/integration/init.py | Package marker for integration tests |
| src/rename_runs.py | Removed unused file for renaming run files |
| src/match_components.py | Added argv parameter to main() for testability |
| src/extract_run_payloads.py | Removed duplicate main() declaration, added argv parameter, added parents=True to mkdir calls |
| src/build_go_terms.py | Added argv parameter to main() for testability |
| src/build_component_mapping.py | Added argv parameter to main() for testability |
| requirements-dev.txt | Added pytest, pytest-cov, and coverage-badge dependencies |
| pyproject.toml | Configured pytest options and coverage settings |
| badges/coverage.svg | Generated coverage badge showing 81% coverage |
| README.md | Added test badges and documentation for running tests |
| Makefile | Added test and coverage targets |
| .github/workflows/tests.yml | Added CI workflow for automated testing with coverage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from src.generate_reports import generate_reports | ||
| from src.build_master_report import main as master_main | ||
| from src.project_paths import resolve_paths | ||
|
|
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing blank line before function definition. According to PEP 8, there should be two blank lines between top-level function definitions.
| [tool.coverage.run] | ||
| source = ["src"] | ||
| branch = true | ||
| omit = ["src/embed_*", "src/build_master_report.py" ] |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace after the closing bracket. Consider removing it for cleaner code.
| omit = ["src/embed_*", "src/build_master_report.py" ] | |
| omit = ["src/embed_*", "src/build_master_report.py"] |
README.md
Outdated
| Pipeline for parsing Perplexity DeepSearch outputs, comparing pseudo-enrichment programs to GO results, and generating figures/reports per project. The current default project is `glioblastoma_perplexity_manual`, but the layout supports multiple projects via per-project subdirectories. | ||
|
|
||
| [](https://github.com/Cellular-Semantics/langpa_validation_tools/actions/workflows/tests.yml) | ||
|  |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage percentage mismatch: The README shows 71% coverage, but the generated SVG badge in badges/coverage.svg shows 81%. These should be consistent. Consider using the badge file directly or ensuring both are updated together.
|  | |
|  |
| terms = pc.parse_unmatched_go_terms(text) | ||
| assert "Term A (GO:1)" in terms | ||
| assert "Term B (GO:2)" in terms | ||
|
|
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing blank line before function definition. According to PEP 8, there should be two blank lines between top-level function definitions.
|
|
||
| from src.process_comparisons import main | ||
| from src.project_paths import resolve_paths | ||
|
|
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing blank line before function definition. According to PEP 8, there should be two blank lines between top-level function definitions.
| @@ -0,0 +1,15 @@ | |||
| import json | |||
| from pathlib import Path | |||
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'Path' is not used.
| from pathlib import Path |
| import json | ||
| from pathlib import Path | ||
|
|
||
| import pytest |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'pytest' is not used.
| import pytest |
| @@ -0,0 +1,49 @@ | |||
| import json | |||
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'json' is not used.
| import json |
| @@ -0,0 +1,34 @@ | |||
| import os | |||
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'os' is not used.
| import os |
| import os | ||
| from pathlib import Path | ||
|
|
||
| import pytest |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'pytest' is not used.
| import pytest |
|
copilot issues are all linting and formatting. Will ignore for now. |
Coverage and CI updates are in:
commits the badge on pushes to main. README now shows the workflow badge and uses the repo-hosted coverage badge.
in build_component_mapping.py, build_go_terms.py, match_components.py, and expanded the master report integration test. Coverage report
now excludes build_master_report.py (report assembler) to focus on logic modules.
All tests pass (pytest), and coverage is ~81%.