Skip to content

🧑‍💻 Optimize PatchPredictor Tests for CI runs#1096

Open
shaneahmed wants to merge 8 commits into
developfrom
optimise-patch-predictor-tests
Open

🧑‍💻 Optimize PatchPredictor Tests for CI runs#1096
shaneahmed wants to merge 8 commits into
developfrom
optimise-patch-predictor-tests

Conversation

@shaneahmed

Copy link
Copy Markdown
Member
  • Optimize PatchPredictor Tests for CI runs

- Optimize `PatchPredictor` Tests for CI runs
@shaneahmed shaneahmed self-assigned this Jul 10, 2026
@shaneahmed shaneahmed added this to the Release v2.1.3 milestone Jul 10, 2026
@shaneahmed shaneahmed added the dev tools Changes/Updates in Development tools label Jul 10, 2026
Comment thread tests/conftest.py Fixed
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.77%. Comparing base (1c94d65) to head (20e2264).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 exercise PatchPredictor.run() without file IO or image decoding.
  • Added fast unit tests for string-model initialization (without weight downloads) and for save_predictions output 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev tools Changes/Updates in Development tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants