forked from qatrackplus/qatrackplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
66 lines (54 loc) · 2.33 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
sudo: required
dist: bionic
language: python
#cache: pip
services:
- mysql
- postgresql
addons:
firefox: latest
postgresql: "12.5"
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
env:
- DJANGO=2.2 DB=sqlite
- DJANGO=2.2 DB=postgres
- DJANGO=2.2 DB=mysql
services:
- xvfb
- postgresql
before_script:
- if [[ $DB == mysql ]]; then mysql -u root < deploy/mysql/create_db_and_role.sql; fi
- if [[ $DB == mysql ]]; then mysql -u root -e "GRANT ALL PRIVILEGES ON * . * TO 'qatrack'@'localhost';"; fi
- if [[ $DB == mysql ]]; then mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql; fi
- if [[ $DB == postgres ]]; then psql -U postgres < deploy/postgres/create_db_and_role.sql; fi
- if [[ $DB == postgres ]]; then psql -U postgres -c "ALTER USER qatrack CREATEDB"; fi
- "export DISPLAY=:99.0"
- sleep 3 # give xvfb some time to start
before_install:
- sudo apt-get update
- sudo apt-get install make build-essential python3-dev python3-tk
- if [[ $DB == mysql ]]; then sudo apt-get install libmysqlclient-dev; fi
#- if [[ $DB == postgres ]]; then sudo apt-get install postgresql libpq-dev postgresql-client postgresql-client-common; fi
- wget https://github.com/mozilla/geckodriver/releases/download/v0.22.0/geckodriver-v0.22.0-linux64.tar.gz
- mkdir geckodriver
- tar -xzf geckodriver-v0.22.0-linux64.tar.gz -C geckodriver
- export PATH=$PATH:$PWD/geckodriver
install:
- pip install --upgrade pip
- pip install flaky
- if [[ $DB == mysql ]]; then pip install -r requirements/mysql.txt; fi
- if [[ $DB == mysql ]]; then cp deploy/mysql/local_settings.py qatrack/local_settings.py; fi
- if [[ $DB == postgres ]]; then pip install -r requirements/postgres.txt; fi
- if [[ $DB == postgres ]]; then cp deploy/postgres/local_settings.py qatrack/local_settings.py; fi
- if [[ $DB == sqlite ]]; then pip install -r requirements/base.txt; fi
- if [[ $DB == sqlite ]]; then cp deploy/sqlite/local_settings.py qatrack/local_settings.py; fi
script:
- cat qatrack/local_settings.py
- if [[ $DB == sqlite ]]; then yes | pytest -x -m "not selenium"; fi
#- if [[ $DB == sqlite ]]; then yes | pytest --force-flaky --max-runs=3 --min-passes=1 -m "selenium"; fi
- if [[ $DB == postgres ]]; then yes | pytest -x -m "not selenium"; fi
- if [[ $DB == mysql ]]; then yes | pytest -x -m "not selenium"; fi