-
Notifications
You must be signed in to change notification settings - Fork 130
/
.travis.yml
58 lines (54 loc) · 2.42 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
sudo: required
dist: bionic
language: python
matrix:
include:
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=PEP8
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=GENERAL
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ENCODINGS
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=GENERAL
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ENCODINGS
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=GRU DEPTH=shallow
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=LSTM DEPTH=shallow
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalGRU DEPTH=shallow
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalLSTM DEPTH=shallow
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=GRU DEPTH=deep DIR=bidir
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalLSTM DEPTH=deep DIR=unidir
- python: 3.7
env: KERAS_BACKEND=tensorflow TEST_MODE=transformer DEPTH=deep DIR=unidir
# command to install dependencies
install:
- travis_wait 30 pip install .
# Install packages to run tests.
- pip install flaky pytest pytest-cache pytest-cov pytest-forked pytest-xdist pyux flake8
# command to run tests
script:
# run keras backend init to initialize backend config
- python -c "import keras.backend"
- sed -i -e 's/"backend":[[:space:]]*"[^"]*/"backend":\ "'$KERAS_BACKEND'/g' ~/.keras/keras.json;
- echo -e "Running tests with the following config:\n$(cat ~/.keras/keras.json)"
- if [[ "$TEST_MODE" == "PEP8" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH python -m flake8 --config=./.flake8 .;
elif [[ "$TEST_MODE" == "GENERAL" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/test_load_params.py tests/utils/ tests/data_engine/ 2>&1 ;
elif [[ "$TEST_MODE" == "ENCODINGS" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/encodings/ 2>&1 ;
else
if [[ "$DEPTH" == "shallow" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/NMT_architectures/${DEPTH}*_${TEST_MODE}.py 2>&1 ;
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/NMT_architectures/attention_${TEST_MODE}.py 2>&1 ;
else
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/NMT_architectures/${DIR}_${DEPTH}*_${TEST_MODE}.py 2>&1 ;
fi
fi