-
Notifications
You must be signed in to change notification settings - Fork 6
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
Properly separate unit tests from system tests WRT subprocess #735
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #735 +/- ##
==========================================
- Coverage 93.19% 92.92% -0.28%
==========================================
Files 37 37
Lines 2072 2063 -9
==========================================
- Hits 1931 1917 -14
- Misses 141 146 +5 ☔ View full report in Codecov by Sentry. |
d4e6d87
to
126c5cd
Compare
Tagged @joeshannon for interest |
See #601 for the old 20 slowest tests
|
src/blueapi/service/runner.py
Outdated
) -> T: | ||
"""Call the supplied function, passing the current Span ID, if one | ||
exists,from the observability context inro the _rpc caller function. | ||
exists,from the observability context inro the import_and_run_function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exists,from the observability context inro the import_and_run_function | |
exists,from the observability context into the import_and_run_function |
nit
src/blueapi/service/runner.py
Outdated
add_span_attributes( | ||
{"_use_subprocess": self._use_subprocess, "_config": str(self._config)} | ||
) | ||
add_span_attributes({"_use_subprocess": True, "_config": str(self._config)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add_span_attributes({"_use_subprocess": True, "_config": str(self._config)}) | |
add_span_attributes({"_config": str(self._config)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see below
src/blueapi/service/runner.py
Outdated
When this is deserialized in and run by the subprocess, this will allow | ||
its functions to use the corresponding span as their parent span.""" | ||
|
||
add_span_attributes({"use_subprocess": True}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must
add_span_attributes({"use_subprocess": True}) |
As discussed offline: we are always using the same value for use_subprocess, as it is no longer an instance variable. Either find a way to mark what type of subprocess_factory
was used or remove.
- Mock subprocess in runner tests - Remove ability of runner to invoke function in the same process, this was previously only used in tests - Expose _rpc function as import_and_run_function, write separate tests for it as it was no longer behind the mock
Mock runner, test REST calls only
af50930
to
7be88ea
Compare
Apologies, I mistakenly believed this was merged. I have rebased and updated the new tests to reflect this scheme. Unfortunately a new slow test has been introduced in the auth code since I did this PR. I suggest making that into a new issue since it only adds 2s to the test time and the acceptance criteria for #601 are still met. Current test times below:
|
Fixes #601