-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat/adding unittests for k8s prereq module #53
Feat/adding unittests for k8s prereq module #53
Conversation
1149441
to
eda70d8
Compare
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.
pytest
is required for unit testing. pyproject.toml
contains configuration to make it work as expected which unittest
to not support (even by command line argument). Later is at least true for 3.12.3 of Python at the time of writing.
load_modules()
is not mockable at the moment as it scans through the rookify.modules
directory to identify modules to be loaded.
forgot to merge this, now have to repair conflicts :) |
79fbc90
to
b758793
Compare
fix: adding 'object' to module path in order to use correct class definition, allows to remove ignore comments for mypy Signed-off-by: Rafael te Boekhorst <[email protected]>
b758793
to
0d69561
Compare
…ordingly Signed-off-by: Boekhorst <[email protected]>
296aafd
to
85503cc
Compare
…r_all_namespaces() Signed-off-by: Boekhorst <[email protected]>
3bea674
to
28f5dfd
Compare
ok repaired it and added another small unittest |
c728caa
to
3a848d2
Compare
Signed-off-by: Boekhorst <[email protected]>
3a848d2
to
4b7a6e9
Compare
Ok I noted an issue: there seems to be some discrepancy between the local pre-comit and the pre-commit run in github actions. I now ran git commit --no-verify to avoid the local pre-commit throwing an error: github actions seems to run through everything fine though |
Signed-off-by: Boekhorst <[email protected]>
Signed-off-by: Boekhorst <[email protected]>
Signed-off-by: Boekhorst <[email protected]>
Signed-off-by: Boekhorst <[email protected]>
cf71ded
to
eb5ae42
Compare
Signed-off-by: Boekhorst <[email protected]>
Signed-off-by: Boekhorst <[email protected]>
51a5aff
to
dad25ec
Compare
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
51f33b4
to
ac7d089
Compare
Signed-off-by: Tobias Wolf <[email protected]>
Modules may only implement either `preflight()` or `execute()` as well. Remove the `@abstractmethod` decorator therefore. Signed-off-by: Tobias Wolf <[email protected]>
4912566
to
5c3852f
Compare
Signed-off-by: Tobias Wolf <[email protected]>
Signed-off-by: Tobias Wolf <[email protected]>
5c3852f
to
dde5d60
Compare
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.
LGTM
.venv/bin/python -m pytest tests/modules/test_k8s_prerequisites_check.py
/app/rookify/.venv/bin/python -m unittest /app/rookify/src/tests/modules/test_k8s_prerequisites_check.py
, also note that these import errors do not occure when testingExampleHandler
module, yet import is done in the same way. Try:/app/rookify/.venv/bin/python -m unittest /app/rookify/src/tests/modules/test_example.py
TestK8sPrerequisitesCheckHandler
itself, thereby keping the code for preflight method the same... maybe you know another way to mock the ModuleHandler before it gets loaded?