Skip to content
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

Improve test coverage in callbacks/broker.py #1685

Open
DominicOram opened this issue Apr 8, 2024 · 4 comments
Open

Improve test coverage in callbacks/broker.py #1685

DominicOram opened this issue Apr 8, 2024 · 4 comments
Labels
good first issue hackathon Good issues for the upcoming bluesky hackathon

Comments

@DominicOram
Copy link
Contributor

Currently broker.py has ~ 44% test coverage. We should improve this to bring it in line with the rest of the project.

@callumforrester callumforrester added the hackathon Good issues for the upcoming bluesky hackathon label Apr 8, 2024
@callumforrester
Copy link
Contributor

This is a good idea but should not up coverage for its own sake: Tests should represent use cases.

Acceptance Criteria:

  • Tests written against use cases
  • Module fully covered

@tacaswell tacaswell changed the title Improve test coverage in broker.py Improve test coverage in callbacks/broker.py Apr 9, 2024
@tacaswell
Copy link
Contributor

The low coverage in that module is because the code both requires significant vertical integration (needs a set up and fed databroker) and requires writing files.

I think adding tests for these is likely to be far more effort than it is worth for (I believe) rarely used consumers.

@callumforrester
Copy link
Contributor

Can it not be written more unit-test-style without the vertical integration? I.e. with mocks etc.

@tacaswell
Copy link
Contributor

You would have to mock out at least DataBroker.fill_events which if you feed it a real document stream is re-implementing a good chunk of the complexity in databroker and I suspect it would be easier to setup the vertical integration on CI!

I'm relatively wary of mocking out complex interfaces. We had a lot of issues early on when we had a "mock ophyd" in bluesky, all the tests would pass....and then we would discover all of the differences between our mock ophyd and real ophyd on the floor!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue hackathon Good issues for the upcoming bluesky hackathon
Projects
Status: Todo
Development

No branches or pull requests

3 participants