forked from celery/celery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
140 lines (129 loc) · 5.02 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
language: python
dist: bionic
cache: pip
python:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
os:
- linux
stages:
- test
- integration
- lint
services:
- redis
- docker
env:
global:
- PYTHONUNBUFFERED=yes
- CELERY_TOX_PARALLEL=
jobs:
- MATRIX_TOXENV=unit
jobs:
fast_finish: true
allow_failures:
- python: '3.9'
include:
- python: '3.9'
env: MATRIX_TOXENV=integration-rabbitmq
stage: integration
- python: 3.8
env: MATRIX_TOXENV=integration-rabbitmq
stage: integration
- python: 3.8
env: MATRIX_TOXENV=integration-redis
stage: integration
- python: 3.8
env: MATRIX_TOXENV=integration-dynamodb
stage: integration
- python: 3.8
env: MATRIX_TOXENV=integration-azureblockblob
stage: integration
- python: 3.8
env: MATRIX_TOXENV=integration-cache
stage: integration
- python: 3.8
env: MATRIX_TOXENV=integration-cassandra
stage: integration
- python: 3.8
env: MATRIX_TOXENV=integration-elasticsearch
stage: integration
- python: '3.8'
env:
- TOXENV=flake8,apicheck,configcheck,bandit
- CELERY_TOX_PARALLEL='--parallel --parallel-live'
stage: lint
- python: pypy3.6-7.3.1
env: TOXENV=pypy3-unit
stage: test
before_install:
- sudo install --directory --owner=travis /var/log/celery /var/run/celery
- sudo apt install libcurl4-openssl-dev libssl-dev gnutls-dev httping expect
- if [[ -v MATRIX_TOXENV ]]; then export TOXENV=${TRAVIS_PYTHON_VERSION}-${MATRIX_TOXENV}; fi; env
- |
if [[ "$TOXENV" == *rabbitmq ]]; then
docker run -d -p 5672:5672 -p 15672:15672 rabbitmq:3.8-management
while ! httping -c1 http://127.0.0.1:15672; do sleep 10; done
fi
- |
if [[ "$TOXENV" =~ "pypy" ]]; then
export PYENV_ROOT="$HOME/.pyenv"
if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
cd "$PYENV_ROOT" && git pull
else
rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/pyenv/pyenv.git "$PYENV_ROOT"
fi
"$PYENV_ROOT/bin/pyenv" install "$PYPY_VERSION"
virtualenv --python="$PYENV_ROOT/versions/$PYPY_VERSION/bin/python" "$HOME/virtualenvs/$PYPY_VERSION"
source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
which python
fi
- |
if [[ "$TOXENV" == *dynamodb ]]; then
docker run -d -p 8000:8000 amazon/dynamodb-local
while ! httping -c1 http://127.0.0.1:8000; do sleep 10; done
fi
- |
if [[ "$TOXENV" == *cache ]]; then
docker run -d -p 11211:11211 memcached:alpine
while ! ./extra/travis/is-memcached-running 127.0.0.1 11211; do sleep 1; done
fi
- |
if [[ "$TOXENV" == *cassandra ]]; then
cassandra_container_id=$(sudo docker run -d -p 9042:9042 cassandra:latest)
sudo docker exec $cassandra_container_id /bin/bash -c "while ! cqlsh -e 'describe cluster'; do sleep 1; done"
sudo docker exec $cassandra_container_id /opt/cassandra/bin/cqlsh -e "CREATE KEYSPACE tests WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };"
sleep 1
sudo docker exec $cassandra_container_id /opt/cassandra/bin/cqlsh -k tests -e "CREATE TABLE tests (task_id text, status text, result blob, date_done timestamp, traceback blob, children blob, PRIMARY KEY ((task_id), date_done)) WITH CLUSTERING ORDER BY (date_done DESC);"
sleep 1
fi
- |
if [[ "$TOXENV" == *elasticsearch ]]; then
elasticsearch_container_id=$(sudo docker run -d -p 9200:9200 -e discovery.type=single-node elasticsearch:7.7.0)
sudo docker exec $elasticsearch_container_id /bin/bash -c "while ! curl '127.0.0.1:9200/_cluster/health?wait_for_status=yellow&timeout=30s'; do sleep 1; done"
fi
- |
docker run -d -e executable=blob -t -p 10000:10000 --tmpfs /opt/azurite/folder:rw arafato/azurite:2.6.5
while ! httping -c1 http://127.0.0.1:10000; do sleep 10; done
export AZUREBLOCKBLOB_URL="azureblockblob://DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;"
- |
wget -qO - https://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add -
sudo apt-add-repository -y 'deb http://packages.couchbase.com/ubuntu bionic bionic/main'
sudo apt-get update && sudo apt-get install -y libcouchbase-dev
install: pip --disable-pip-version-check install --upgrade-strategy eager -U tox | cat
script: tox $CELERY_TOX_PARALLEL -v -- -v
after_success:
- |
if [[ -v MATRIX_TOXENV || "$TOXENV" =~ "pypy" ]]; then
.tox/$TOXENV/bin/coverage xml
.tox/$TOXENV/bin/codecov -e TOXENV
fi;
notifications:
email: false
irc:
channels:
- "chat.freenode.net#celery"
on_success: change
on_failure: change