Add unit tests for version - #334
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds unit tests to verify the compass package exposes a properly formatted __version__ attribute. The tests ensure the version string exists, is non-empty, and follows semantic versioning with optional development version suffixes (e.g., 0.11.3.dev8+gHASH).
- Validates the presence and type of the
__version__attribute - Checks that the version string matches a semantic versioning pattern with optional dev suffixes
- Guards against placeholder version values like "9999"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
castelao
left a comment
There was a problem hiding this comment.
Is the idea here to capture a bad pipeline that would result in a bad setup, such as a docker container built with the wrong version?
Yes that was what I was thinking! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #334 +/- ##
==========================================
+ Coverage 36.50% 36.55% +0.04%
==========================================
Files 45 45
Lines 4240 4240
Branches 380 380
==========================================
+ Hits 1548 1550 +2
+ Misses 2670 2669 -1
+ Partials 22 21 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I guess the downside to this test is that all our actions now have to run with a |
I agree, I don't think it is a big deal to require I don't see a clear benefit with this test here, but if you want to add it, I support you. |
|
Let's add it and see if it gets annoying. If it does, happy to remove it |
* Add unit tests for version access and semantic validation * Implement copilot suggestion * Add full repo history fetch * Add check for `10000` version case * Full fetch depth for codecov action
Pull Request Overview
Introduce unit tests to verify the presence and semantic correctness of the
__version__attribute in the compass module. These tests ensure compliance with the expected versioning format.Notes
Just a few quick tests. Not super important but might help us in the long run to catch tricky edge case issues, especially when running tests on some remote mahcines