-
Notifications
You must be signed in to change notification settings - Fork 3
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
Run CI tests against multiple versions #246
Conversation
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## stable #246 +/- ##
==========================================
- Coverage 70.28% 70.25% -0.04%
==========================================
Files 82 82
Lines 7462 7477 +15
Branches 1385 1387 +2
==========================================
+ Hits 5245 5253 +8
- Misses 1842 1849 +7
Partials 375 375
Flags with carried forward coverage won't be shown. Click here to find out more.
|
f69736f
to
212da2c
Compare
INFRAHUB_VERSION = os.getenv("INFRAHUB_TESTING_IMAGE_VER", "latest") | ||
|
||
|
||
def skip_version(min_infrahub_version: str | None = None, max_infrahub_version: str | None = None) -> bool: |
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.
When is it that this skip_version function gets used?
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.
Whenever a SDK test should be running prior/since a given infrahub version. We do not have such tests for now, but should have some in the future
This PR enables CI tests to run against both latest infrahub server version and local version of stable/develop branch. Version is set using
INFRAHUB_TESTING_IMAGE_VER
environment variable (that we already use within python_testcontainers, and related logic should be simplified when this PR is cleaned/finalized).Ideally, we would also like to have an
---infrahub-version
cli argument for users convenience. Adding such a parameter requires to definepytest_adoption
within aconftest.py
file. However, having thisconftest.py
being loaded when a user runs a test requires either of the tests to be located in the same folder/subfolders ofconftest.py
- and it should not be the case. So, we need a more elaborated pytest plugin/hook mechanism that would deserve a dedicated PR.Note that we may later want to run sdk tests at least against pinned major infrahub versions.