-
Notifications
You must be signed in to change notification settings - Fork 40
[test] fix start_test failing to import SECOM_CONFIG from stream_test #3317
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
base: master
Are you sure you want to change the base?
[test] fix start_test failing to import SECOM_CONFIG from stream_test #3317
Conversation
Commit da7ef8e (Extend SPARC acquisition to support rotation) updated the stream_test and broke it into different files. However, this broken start_test which relied on it to define SECOM_CONFIG. => Just hard-code separately SECOM_CONFIG in start_test.
📝 WalkthroughWalkthroughThe pull request modifies 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/odemis/odemisd/test/start_test.py (2)
14-14: Useos.path.join()andos.path.normpath()for path construction.The current implementation uses string concatenation for path construction, which is error-prone. Replace with
os.path.join()for clarity andos.path.normpath()to properly resolve the../../navigation.♻️ Proposed refactor
-CONFIG_PATH = os.path.dirname(odemis.__file__) + "/../../install/linux/usr/share/odemis/" +CONFIG_PATH = os.path.normpath(os.path.join(os.path.dirname(odemis.__file__), "..", "..", "install", "linux", "usr", "share", "odemis"))
15-15: Consider usingos.path.join()for cross-platform path construction.Both line 14 and line 15 use string concatenation for path construction. While the current approach works (the config file exists at the constructed path), using
os.path.join()is better practice for portability across different operating systems:CONFIG_PATH = os.path.join(os.path.dirname(odemis.__file__), "..", "..", "install", "linux", "usr", "share", "odemis") SECOM_CONFIG = os.path.join(CONFIG_PATH, "sim", "secom-sim.odm.yaml")
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/odemis/odemisd/test/start_test.py
🧰 Additional context used
🧬 Code graph analysis (1)
src/odemis/odemisd/test/start_test.py (1)
src/odemis/odemisd/start.py (1)
find_window(600-623)
🪛 GitHub Actions: Linting
src/odemis/odemisd/test/start_test.py
[error] 1-1: Contains forbidden metadata chunks (pngcheck detected prohibited PNG metadata).
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: CodeQL analysis (python)
- GitHub Check: build (ubuntu-24.04)
- GitHub Check: build (ubuntu-22.04)
🔇 Additional comments (1)
src/odemis/odemisd/test/start_test.py (1)
1-1: LGTM: Import additions are appropriate.The additions of
osandodemisimports are necessary and correct for constructing the configuration path locally.Also applies to: 10-10
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.
Pull request overview
This PR fixes a broken import in start_test.py that was caused by refactoring of stream_test module. The test file previously imported SECOM_CONFIG from odemis.acq.test.stream_test, but after the module was split into multiple files, this import no longer works. The solution hard-codes the SECOM_CONFIG path definition directly in start_test.py instead.
Key changes:
- Replaced broken import with local definition of
SECOM_CONFIG - Added
osandodemisimports to support the path construction - Defined
CONFIG_PATHandSECOM_CONFIGconstants using the same pattern as other test files in the codebase
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Commit da7ef8e (Extend SPARC acquisition to support rotation)
updated the stream_test and broke it into different files. However, this
broken start_test which relied on it to define SECOM_CONFIG.
=> Just hard-code separately SECOM_CONFIG in start_test.