Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fc82c68

Browse files
committedOct 19, 2021
Action: Add Django test
1 parent d6b96dd commit fc82c68

File tree

3 files changed

+20
-79
lines changed

3 files changed

+20
-79
lines changed
 

‎.github/workflows/sqlalchemy.yaml renamed to ‎.github/workflows/django.yaml

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: SQLAlchemy compat test
1+
name: Django compat test
22

33
on:
44
push:
@@ -11,14 +11,15 @@ jobs:
1111
- name: Start MySQL
1212
run: |
1313
sudo systemctl start mysql.service
14-
mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; CREATE DATABASE test_schema CHARSET utf8mb4; GRANT ALL ON test_schema.* TO scott;"
14+
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -proot mysql
15+
mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; GRANT ALL ON *.* TO scott;"
1516
1617
- uses: actions/cache@v2
1718
with:
1819
path: ~/.cache/pip
19-
key: ${{ runner.os }}-sqla-pip-1
20+
key: ${{ runner.os }}-django-pip-1
2021
restore-keys: |
21-
${{ runner.os }}-sqla-pip-
22+
${{ runner.os }}-pip-
2223
2324
- name: Set up Python 3.10
2425
uses: actions/setup-python@v2
@@ -35,13 +36,16 @@ jobs:
3536
PIP_DISABLE_PIP_VERSION_CHECK: 1
3637
run: |
3738
pip install -U pytest pytest-cov
38-
#python setup.py develop
39-
pip install mysqlclient # Use stable version
39+
pip install .
40+
# pip install mysqlclient # Use stable version
4041
41-
- name: Run SQLAlchemy test
42+
- name: Run Django test
43+
env:
44+
DJANGO_VERSION: "2.2.24"
4245
run: |
43-
wget https://files.pythonhosted.org/packages/69/2b/f0ee898c3270d965300ec30b0bf06e062c4cc92f35d17ae6046f429c5067/SQLAlchemy-1.4.25.tar.gz
44-
tar xf SQLAlchemy-1.4.25.tar.gz
45-
cd SQLAlchemy-1.4.25
46-
pip install .
47-
pytest --dburi=mysql://scott:tiger@127.0.0.1:3306/test_schema?charset=utf8mb4 test/
46+
wget https://github.com/django/django/archive/${DJANGO_VERSION}.tar.gz
47+
tar xf ${DJANGO_VERSION}.tar.gz
48+
pip install django-${DJANGO_VERSION}/
49+
cp ci/test_mysql.py django-${DJANGO_VERSION}/tests/
50+
cd django-${DJANGO_VERSION}/tests/
51+
./runtests.py --parallel=2 --settings=test_mysql

‎.travis.yml

-63
This file was deleted.

‎ci/test_mysql.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
"default": {
1717
"ENGINE": "django.db.backends.mysql",
1818
"NAME": "django_default",
19-
"USER": "django",
2019
"HOST": "127.0.0.1",
21-
"PASSWORD": "secret",
20+
"USER": "scott",
21+
"PASSWORD": "tiger",
2222
"TEST": {"CHARSET": "utf8mb4", "COLLATION": "utf8mb4_general_ci"},
2323
},
2424
"other": {
2525
"ENGINE": "django.db.backends.mysql",
2626
"NAME": "django_other",
27-
"USER": "django",
2827
"HOST": "127.0.0.1",
29-
"PASSWORD": "secret",
28+
"USER": "scott",
29+
"PASSWORD": "tiger",
3030
"TEST": {"CHARSET": "utf8mb4", "COLLATION": "utf8mb4_general_ci"},
3131
},
3232
}

0 commit comments

Comments
 (0)
Please sign in to comment.