mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
Add tests for mysql and postgresql
This commit is contained in:
parent
4f87c848a5
commit
bdd5fa96e7
36
.github/workflows/mysql.yaml
vendored
Normal file
36
.github/workflows/mysql.yaml
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# MySQL Unit Testing
|
||||||
|
|
||||||
|
name: MySQL
|
||||||
|
|
||||||
|
on: ["push", "pull_request"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql
|
||||||
|
env:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get install mysql-server libmysqlclient-dev
|
||||||
|
pip3 install invoke
|
||||||
|
pip3 install mysqlclient
|
||||||
|
invoke install
|
||||||
|
- name: Create Database
|
||||||
|
run: |
|
||||||
|
mysql -e 'CREATE DATABASE inventree_test_db;'
|
||||||
|
- name: Run Tests
|
||||||
|
run: |
|
||||||
|
cd InvenTree
|
||||||
|
python3 manage.py test --settings=InvenTree.ci_mysql
|
38
.github/workflows/postgresql.yaml
vendored
Normal file
38
.github/workflows/postgresql.yaml
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# PostgreSQL Unit Testing
|
||||||
|
|
||||||
|
name: PostgreSQL
|
||||||
|
|
||||||
|
on: ["push", "pull_request"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
env:
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get install libpq-dev
|
||||||
|
pip3 install invoke
|
||||||
|
pip3 install pyscopg2
|
||||||
|
invoke install
|
||||||
|
- name: Create Database
|
||||||
|
run: |
|
||||||
|
psql -c 'create database inventree_test_db;' -U postgres
|
||||||
|
- name: Run Tests
|
||||||
|
run: |
|
||||||
|
cd InvenTree
|
||||||
|
python3 manage.py test --settings=InvenTree.ci_postgresql
|
||||||
|
|
@ -13,5 +13,5 @@ if 'test' in sys.argv:
|
|||||||
'ENGINE': 'django.db.backends.postgresql',
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
'NAME': 'inventree_test_db',
|
'NAME': 'inventree_test_db',
|
||||||
'USER': 'postgres',
|
'USER': 'postgres',
|
||||||
'PASSWORD': '',
|
'PASSWORD': 'password',
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user