Skip to content

Add reset_signal_on_update_mock_factory util - #2262

Merged
oliwenmandiamond merged 2 commits into
mainfrom
add_reset_signal_on_update_mock_factory
Nov 9, 2026
Merged

oliwenmandiamond merged 2 commits into
mainfrom
add_reset_signal_on_update_mock_factory

Conversation

@oliwenmandiamond

Copy link
Copy Markdown
Contributor

Add reset_signal_on_update_mock_factory util. Allows user to easily add mock behaviour to a device to reset signals back to a state when their state has changed. A very common example is that when a device has a PV which need to be updated, the IOC will do something and then reset it back to a state. However, we have to add that reset state ourselves for tests and mock behaviour so the device doesn't get stuck waiting for it to change . This adds a helper util factory method to this.

Instructions to reviewer on how to test:

  1. Implementation makes sense
  2. Tests pass

Checks for reviewer

  • Would the PR title make sense to a scientist on a set of release notes
  • If a new device has been added does it follow the standards
  • If changing the API for a pre-existing device, ensure that any beamlines using this device have updated their Bluesky plans accordingly
  • Have the connection tests for the relevant beamline(s) been run via dodal connect ${BEAMLINE}

@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.30%. Comparing base (c7369b0) to head (e70c19c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2262   +/-   ##
=======================================
  Coverage   99.30%   99.30%           
=======================================
  Files         377      378    +1     
  Lines       14857    14865    +8     
=======================================
+ Hits        14754    14762    +8     
  Misses        103      103           

☔ 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.

@oliwenmandiamond
oliwenmandiamond marked this pull request as ready for review November 9, 2026 15:44
@oliwenmandiamond
oliwenmandiamond requested a review from a team as a code owner November 9, 2026 15:44

@DominicOram DominicOram 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.

Looks useful, thanks!

@oliwenmandiamond
oliwenmandiamond merged commit 5089bdf into main Nov 9, 2026
19 of 20 checks passed
@oliwenmandiamond
oliwenmandiamond deleted the add_reset_signal_on_update_mock_factory branch November 9, 2026 16:15
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.

2 participants