🧑💻 Optimize PatchPredictor Tests for CI runs#1096
Open
shaneahmed wants to merge 8 commits into
Open
Conversation
- Optimize `PatchPredictor` Tests for CI runs
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1096 +/- ##
===========================================
- Coverage 99.88% 99.77% -0.12%
===========================================
Files 86 86
Lines 11661 11661
Branches 1531 1531
===========================================
- Hits 11648 11635 -13
- Misses 7 17 +10
- Partials 6 9 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Optimizes PatchPredictor test execution for CI by introducing lightweight in-memory tests (no downloads / minimal IO) and skipping heavier integration-style tests when running on CI.
Changes:
- Added a
FakeMiniModel+ patched dataloader fixture to exercisePatchPredictor.run()without file IO or image decoding. - Added fast unit tests for string-model initialization (without weight downloads) and for
save_predictionsoutput formats. - Marked multiple existing integration tests as CI-skipped via
running_on_ci().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+980
to
984
| def _extract_probabilities_from_annotation_store(db_file: str | Path) -> dict: | ||
| """Helper function to extract probabilities from Annotation Store.""" | ||
| con = sqlite3.connect(dbfile) | ||
| con = sqlite3.connect(db_file) | ||
| cur = con.cursor() | ||
| annotations_properties = list(cur.execute("SELECT properties FROM annotations")) |
Comment on lines
+39
to
+43
| class FakeMiniModel(ModelABC): | ||
| """Lightweight model double with a realistic TIAToolbox-style interface.""" | ||
|
|
||
| class_dict = {0: "background", 1: "tumour"} # noqa: RUF012 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PatchPredictorTests for CI runs