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 the kubernetes test #3101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix the kubernetes test #3101

wants to merge 2 commits into from

Conversation

abjorkl5
Copy link

I was trying to run the kubernetes test, but it didn't pass.

With these changes, it was able to pass using minikube.


  • When a job fails, it asserts rather than exits

  • There are other labels besides the custom ones

  • Need to mock out the verify_job_has_started()

  • Showing the pods requires access to the cluster

- When a job fails, it asserts rather than exits

- There are other labels besides the custom ones

- Need to mock out the verify_job_has_started()

- Showing the pods requires access to the cluster
@abjorkl5 abjorkl5 requested review from dlstadther, Tarrasch and a team as code owners August 30, 2021 15:26
If setting up a custom cluster instead of minikube.

Respect the traditional environment variable too.
@abjorkl5
Copy link
Author

I noticed there were some much bigger changes done in #3093

These were more for testing the old code, rather than change it

@AndrewFarley
Copy link

@abjorkl5 Can I ask you what command(s) are you using to run the tests? Even with the previous generation of tests, I was never able to run the tests successfully for a variety of reasons, and that is delaying the tests on my big MR upgrading the k8s library of Luigi. And/or, can you maybe jump into my MR and help me fix up all the tests and make some new ones? I want to test every failure condition ideally, and I'm not good at pytest, having never really used it before.

@abjorkl5
Copy link
Author

I was using this command:

PYTHONPATH=. luigi --module examples.kubernetes PerlPi --local-scheduler

But I didn't want to change the example instructions in this PR (for the test)
I think it said "kubernetes_job" by mistake ? Basically, I was doing Nomad...

And for the unit test, I used:

pytest-3 test/contrib/kubernetes_test.py

I had to comment out some unsupported --cov option, though. (in tox.ini)

ERROR: usage: pytest-3 [options] [file_or_dir] [file_or_dir] [...]
pytest-3: error: unrecognized arguments: --cov=luigi

This was on Ubuntu 20.04

@AndrewFarley
Copy link

Thanks for that @abjorkl5, when I have some time on the weekend I'll hopefully take a look at this MR and merge it into my #3093 refactor and improve the tests there. This critical feature really needs some good tests. Cheers!

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If closed, you may revisit when your time allows and reopen! Thank you for your contributions.

@stale stale bot added the wontfix label Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants