2019-04-13 22:34:37 +00:00
|
|
|
dist: xenial
|
|
|
|
|
2020-09-01 11:01:38 +00:00
|
|
|
services:
|
|
|
|
- mysql
|
|
|
|
- postgresql
|
|
|
|
|
2017-03-23 21:34:41 +00:00
|
|
|
language: python
|
|
|
|
python:
|
2019-07-08 09:23:30 +00:00
|
|
|
- 3.6
|
2019-07-08 09:24:46 +00:00
|
|
|
- 3.7
|
2019-04-13 22:34:37 +00:00
|
|
|
|
|
|
|
addons:
|
|
|
|
apt-packages:
|
2020-02-02 00:52:22 +00:00
|
|
|
- sqlite3
|
2017-03-23 21:34:41 +00:00
|
|
|
|
|
|
|
before_install:
|
2019-09-26 00:16:45 +00:00
|
|
|
- sudo apt-get update
|
|
|
|
- sudo apt-get install gettext
|
2020-09-01 11:21:32 +00:00
|
|
|
- sudo apt-get install mysql-server libmysqlclient-dev
|
2020-09-01 11:24:19 +00:00
|
|
|
- sudo apt-get install libpq-dev
|
2020-08-21 11:27:39 +00:00
|
|
|
- pip3 install invoke
|
2020-09-01 11:13:38 +00:00
|
|
|
- pip3 install mysqlclient
|
|
|
|
- pip3 install psycopg2
|
2020-08-21 11:27:39 +00:00
|
|
|
- invoke install
|
|
|
|
- invoke migrate
|
2019-09-10 04:40:29 +00:00
|
|
|
- cd InvenTree && python3 manage.py createsuperuser --username InvenTreeAdmin --email admin@inventree.com --noinput && cd ..
|
2020-09-01 11:01:38 +00:00
|
|
|
- psql -c 'create database inventree_test_db;' -U postgres
|
2020-09-01 11:08:58 +00:00
|
|
|
- mysql -e 'CREATE DATABASE inventree_test_db;'
|
2017-04-10 20:55:55 +00:00
|
|
|
|
2017-03-23 21:34:41 +00:00
|
|
|
script:
|
2019-09-15 13:43:39 +00:00
|
|
|
- cd InvenTree && python3 manage.py makemigrations && cd ..
|
2019-09-15 13:42:36 +00:00
|
|
|
- python3 ci/check_migration_files.py
|
2020-11-12 02:31:27 +00:00
|
|
|
# Run unit testing / code coverage tests
|
2020-08-21 11:27:39 +00:00
|
|
|
- invoke coverage
|
2020-11-12 02:31:27 +00:00
|
|
|
# Run unit test for SQL database backend
|
2020-09-02 09:47:07 +00:00
|
|
|
- cd InvenTree && python3 manage.py test --settings=InvenTree.ci_mysql && cd ..
|
2020-11-12 02:31:27 +00:00
|
|
|
# Run unit test for PostgreSQL database backend
|
2020-09-02 09:47:07 +00:00
|
|
|
- cd InvenTree && python3 manage.py test --settings=InvenTree.ci_postgresql && cd ..
|
2020-08-21 11:27:39 +00:00
|
|
|
- invoke translate
|
|
|
|
- invoke style
|
2020-11-12 02:31:27 +00:00
|
|
|
# Create an empty database and fill it with test data
|
2020-11-12 04:37:21 +00:00
|
|
|
- rm inventree_default_db.sqlite3
|
2020-11-12 02:31:27 +00:00
|
|
|
- invoke migrate
|
|
|
|
- invoke import-fixtures
|
|
|
|
# Export database records
|
|
|
|
- invoke export-records -f data.json
|
|
|
|
# Create a new empty database and import the saved data
|
2020-11-12 04:37:21 +00:00
|
|
|
- rm inventree_default_db.sqlite3
|
2020-11-12 05:41:43 +00:00
|
|
|
- invoke migrate
|
2020-11-12 02:31:27 +00:00
|
|
|
- invoke import-records -f data.json
|
2019-04-24 05:32:50 +00:00
|
|
|
|
2019-04-24 05:36:45 +00:00
|
|
|
after_success:
|
2019-04-24 05:32:50 +00:00
|
|
|
- coveralls
|