Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Speed up unit tests and fix some typing issues #1256

Merged
merged 3 commits into from
Mar 14, 2024
Merged

Conversation

DominicOram
Copy link
Collaborator

Fixes #1220

  • Removes logging by default, as discussed on issue
  • Also speeds up a few other tests

To test:

  1. Run the tests with pytest -m "not s03", confirm they all pass in ~30s
  2. Confirm the tests in CI are still getting all the logs written to terminal

@DominicOram DominicOram marked this pull request as ready for review March 13, 2024 18:20
@dperl-dls dperl-dls changed the title Speed up unit tests Speed up unit tests and fix some typing issues Mar 14, 2024
Copy link
Collaborator

@dperl-dls dperl-dls left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

This feels unrelated?

Copy link
Collaborator

Choose a reason for hiding this comment

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

But it's fine, I just updated the title to match

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not completely unrelated, stopping test_given_detector_bit_depth_changes_then_vds_datatype_as_expected from file writing/reading sped up the tests by ~3 seconds. But I felt we should have something to test that vds was being written vaguely correctly so put it in test_rotation_scan_nexus_output_compared_to_existing_file (which we maybe could argue should be a system test as it takes a couple of seconds and depends on:

  • Nexgen code
  • Reading/writing from the filesystem

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, you meant the typing issue? Sure, slightly unrelated, just leaving the code better than I found it

@DominicOram DominicOram merged commit 0a46bcf into main Mar 14, 2024
30 checks passed
@DominicOram DominicOram deleted the 1220_slow_unit_tests branch March 14, 2024 11:23
olliesilvester pushed a commit to olliesilvester/mx-bluesky that referenced this pull request Aug 23, 2024
…Source/1220_slow_unit_tests

Speed up unit tests and fix some typing issues
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate slowness of unit tests
2 participants