Skip to content
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

Fix/adding tests to k8s prerequisits branch #52

Conversation

boekhorstb1
Copy link
Contributor

  • added unittests: note that these only run with pytest currently. Try: .venv/bin/python -m pytest tests/modules/test_k8s_prerequisites_check.py
  • when running with unittest there are various import errors. Try: /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 testing ExampleHandler 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
  • because the ModuleHandler loads all the module, I found that I had to mock the class TestK8sPrerequisitesCheckHandler itself, thereby keping the code for preflight method the same... maybe you know another way to mock the ModuleHandler before it gets loaded?

- add containername so makefile can easily reach the container always

Signed-off-by: Rafael te Boekhorst <[email protected]>
…ed variable and useing venv direclty

Signed-off-by: Rafael te Boekhorst <[email protected]>
…onfig.example.yml to working directory

Signed-off-by: Rafael te Boekhorst <[email protected]>
Signed-off-by: Rafael te Boekhorst <[email protected]>
@boekhorstb1 boekhorstb1 changed the base branch from main to prs/add-k8s-prerequisites-check June 11, 2024 15:32
@NotTheEvilOne NotTheEvilOne deleted the fix/adding-tests-to-k8s-prerequisits-branch branch November 28, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant