-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
[AIRFLOW-3367] Run celery integration test with redis broker. #4207
Conversation
0cf2475
to
16b3c3a
Compare
Codecov Report
@@ Coverage Diff @@
## master #4207 +/- ##
===========================================
- Coverage 78.07% 16.05% -62.03%
===========================================
Files 201 201
Lines 16455 16455
===========================================
- Hits 12848 2642 -10206
- Misses 3607 13813 +10206
Continue to review full report at Codecov.
|
Hi @jmcarp Thanks for picking this up. Preferably you run the tests against your own Travis instance first, instead of using the Apache Travis. The hours of Apache Travis are paid, and on your own fork is for free :-) I don't see any changes in the tests itself. Maybe it would be nice to add a test like: Run a dag with a RedisSensor, and make sure that it will pass. So we have some actual code which communicates with Travis (and therefore also uses the RedisHook). |
Please consult with #4090 before you do any duplicate work :-) |
@Fokko: sorry, I didn't realize this was a paid travis account. Anyway, the idea here is to test the redis backend for celery, not the redis hook or sensor, which is why I changed the test configuration but not the test code. I'll continue with this locally or on my own travis for now. |
675be46
to
bd7f9cf
Compare
cc @ashb |
a885f33
to
ae3447d
Compare
ae3447d
to
ebbfab3
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.
Looks good overall though!
test_execute_command = test_app.task(execute_command.__wrapped__) | ||
patch_execute_command = mock.patch( | ||
'airflow.executors.celery_executor.execute_command', | ||
test_execute_command) |
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.
Could all this be packaged/encapsulated in a helper function so that the "core" bit of the test (i.e. the bits you haven't changed) remains clear?
from airflow.executors.celery_executor import app | ||
from airflow.executors.celery_executor import CeleryExecutor | ||
from airflow.executors.celery_executor import execute_command | ||
from airflow.executors.celery_executor import celery_configuration | ||
from airflow.executors.celery_executor import CELERY_FETCH_ERR_MSG_HEADER |
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.
from airflow.executors.celery_executor import (
CELERY_FETCH_ERR_MSG_HEADER,
CeleryExecutor
app,
celery_configuration,
execute_command,
)
please :)
ebbfab3
to
28a6d3b
Compare
Thanks for reviewing @ashb! I updated the tests like you suggested. |
820e6ea
to
279046c
Compare
Conflicts fixed, ready for another look @ashb. |
279046c
to
c101055
Compare
c101055
to
6f7c5cf
Compare
Ping @ashb. Hopefully this will be quick to review, since most of the diff is indenting for context managers. |
LGTM, sorry for the delayed reply. I'm currently a bit short on time :( |
(cherry picked from commit 5710ef2)
(cherry picked from commit 5710ef2)
(cherry picked from commit 5710ef2)
Not sure if this is the right approach; submitting to test on travis.
Make sure you have checked all steps below.
Jira
Description
Run celery integration tests with both rabbitmq and redis brokers.
Tests
Patch runs existing test with multiple celery brokers.
Commits
Documentation
Code Quality
flake8