Commit f027d60 1 parent 93a2ea7 commit f027d60 Copy full SHA for f027d60
File tree 5 files changed +23
-4
lines changed
5 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -20,4 +20,11 @@ set -exuo pipefail
20
20
21
21
MYSQL_HOST=mysql
22
22
23
- mysql -h ${MYSQL_HOST} -u root -e ' drop database if exists airflow; create database airflow'
23
+ retries=3
24
+ for (( i= 0 ; i< retries; i++ )) ; do
25
+ mysql -h ${MYSQL_HOST} -u root -e ' drop database if exists airflow; create database airflow' && exit 0
26
+ echo " mysql db creation did not succeed, waiting 5 seconds to retry"
27
+ sleep 5
28
+ done
29
+
30
+ echo " mysql db creation could not succeed" && exit 1
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ airflow_home = ~/airflow
21
21
dags_folder = ~/airflow/dags
22
22
base_log_folder = ~/airflow/logs
23
23
executor = LocalExecutor
24
- sql_alchemy_conn = mysql://root@mysql/airflow
24
+ sql_alchemy_conn = # overridden by tox.ini
25
25
unit_test_mode = True
26
26
load_examples = True
27
27
donot_pickle = False
@@ -56,7 +56,7 @@ celery_app_name = airflow.executors.celery_executor
56
56
worker_concurrency = 16
57
57
worker_log_server_port = 8793
58
58
broker_url = amqp://guest:guest@rabbitmq:5672/
59
- result_backend = db+mysql://root@mysql/airflow
59
+ result_backend = # overridden by tox.ini
60
60
flower_port = 5555
61
61
default_queue = default
62
62
Original file line number Diff line number Diff line change @@ -221,4 +221,9 @@ def test_deprecated_options_cmd(self):
221
221
conf .set ('celery' , 'celery_result_backend_cmd' , '/bin/echo 99' )
222
222
223
223
with self .assertWarns (DeprecationWarning ):
224
+ tmp = None
225
+ if 'AIRFLOW__CELERY__RESULT_BACKEND' in os .environ :
226
+ tmp = os .environ .pop ('AIRFLOW__CELERY__RESULT_BACKEND' )
224
227
self .assertEquals (conf .getint ('celery' , 'result_backend' ), 99 )
228
+ if tmp :
229
+ os .environ ['AIRFLOW__CELERY__RESULT_BACKEND' ] = tmp
Original file line number Diff line number Diff line change 24
24
from airflow .executors .celery_executor import app
25
25
from airflow .utils .state import State
26
26
27
+ from airflow import configuration
28
+ configuration .load_test_config ()
29
+
27
30
# leave this it is used by the test worker
28
31
import celery .contrib .testing .tasks # noqa: F401
29
32
30
33
31
34
class CeleryExecutorTest (unittest .TestCase ):
35
+ @unittest .skipIf ('sqlite' in configuration .conf .get ('core' , 'sql_alchemy_conn' ),
36
+ "sqlite is configured with SequentialExecutor" )
32
37
def test_celery_integration (self ):
33
38
executor = CeleryExecutor ()
34
39
executor .start ()
Original file line number Diff line number Diff line change @@ -44,7 +44,9 @@ setenv =
44
44
KRB5_CONFIG =/etc/krb5.conf
45
45
KRB5_KTNAME =/etc/airflow.keytab
46
46
backend_mysql: AIRFLOW__CORE__SQL_ALCHEMY_CONN =mysql://root@mysql/airflow
47
+ backend_mysql: AIRFLOW__CELERY__RESULT_BACKEND =db+mysql://root@mysql/airflow
47
48
backend_postgres: AIRFLOW__CORE__SQL_ALCHEMY_CONN =postgresql+psycopg2://postgres:airflow@postgres/airflow
49
+ backend_postgres: AIRFLOW__CELERY__RESULT_BACKEND =db+postgresql://postgres:airflow@postgres/airflow
48
50
backend_sqlite: AIRFLOW__CORE__SQL_ALCHEMY_CONN =sqlite:///{homedir}/airflow.db
49
51
backend_sqlite: AIRFLOW__CORE__EXECUTOR =SequentialExecutor
50
52
@@ -55,7 +57,7 @@ commands =
55
57
pip install --progress-bar off --find-links ={homedir}/.wheelhouse --no-index -e .[devel_ci]
56
58
env_docker: {toxinidir}/scripts/ci/1-setup-env.sh
57
59
env_docker: {toxinidir}/scripts/ci/2-setup-kdc.sh
58
- env_docker : {toxinidir}/scripts/ci/3-setup-databases .sh
60
+ backend_mysql : {toxinidir}/scripts/ci/3-setup-mysql .sh
59
61
{toxinidir}/scripts/ci/5-run-tests.sh []
60
62
{toxinidir}/scripts/ci/6-check-license.sh
61
63
codecov -e TOXENV
You can’t perform that action at this time.
0 commit comments