-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Add missing docker test_exceptions.py #35674
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
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.
I'm not sure these tests really check much. I might suggest adding tests to this block
airflow/airflow/providers/docker/operators/docker.py
Lines 432 to 437 in 9103ea1
if result["StatusCode"] in self.skip_on_exit_code: | |
raise DockerContainerFailedSkipException( | |
f"Docker container returned exit code {self.skip_on_exit_code}. Skipping.", logs=log_lines | |
) | |
elif result["StatusCode"] != 0: | |
raise DockerContainerFailedException(f"Docker container failed: {result!r}", logs=log_lines) |
I am not sure if I understood your comment, can you please give some detail if possible ? |
It seems to me that the test we're having in this PR might not actually test meaningful things. So, if we're to add tests to cover the exception, maybe the code block I pasted could be a choice |
Thank you for the clarification, I will work on the change. |
373d283
to
65bbc16
Compare
353cfda
to
95a5cb2
Compare
@Lee-W ? Are you happy ? |
Hi all, sorry for the late review. Wasn't feeling well lately. let me review it now |
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.
Looks awesome! @rpkay Thanks for your great work!
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Thank you @Lee-W for your guidance. Special thanks to @Taragolis for code reference. |
* test case for docker exceptions * removed docker test exception * re-wrote test case based on feedback
* test case for docker exceptions * removed docker test exception * re-wrote test case based on feedback
This PR adds a simple test for docker exceptions (DockerContainerFailedException, DockerContainerFailedSkipException)
Part of #35442
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.