From 462a74c84c5949c7b17b4819415516eec02958b5 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 7 Feb 2019 18:45:22 +0900 Subject: [PATCH 1/4] travis: run django-1.11.18 tests with Python 2.7 --- .travis.yml | 19 +++++++++++++++++++ ci/test_mysql.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 ci/test_mysql.py diff --git a/.travis.yml b/.travis.yml index 6a1df409..9c120dbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,4 +36,23 @@ script: after_succes: - codecov +matrix: + include: + - python: "2.7" + install: + - pip install -U pip + - wget https://github.com/django/django/archive/1.11.18.tar.gz + - tar xf 1.11.18.tar.gz + - pip install django-1.11.18/ + - cp ci/test_mysql.py django-1.11.18/tests/ + - pip install . + + before_script: + - mysql -e 'create user django identified by "secret"' + - mysql -e 'grant all on *.* to django' + + script: + - cd django-1.11.18/tests/ + - ./runtests.py -v2 --parallel=1 --settings=test_mysql + # vim: sw=2 ts=2 sts=2 diff --git a/ci/test_mysql.py b/ci/test_mysql.py new file mode 100644 index 00000000..d24f30f1 --- /dev/null +++ b/ci/test_mysql.py @@ -0,0 +1,45 @@ +# This is an example test settings file for use with the Django test suite. +# +# The 'sqlite3' backend requires only the ENGINE setting (an in- +# memory database will be used). All other backends will require a +# NAME and potentially authentication information. See the +# following section in the docs for more information: +# +# https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/ +# +# The different databases that Django supports behave differently in certain +# situations, so it is recommended to run the test suite against as many +# database backends as possible. You may want to create a separate settings +# file for each of the backends you test against. + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'django_default', + 'USER': 'django', + 'HOST': '127.0.0.1', + 'PASSWORD': 'secret', + 'TEST': { + 'CHARSET': 'utf8mb4', + 'COLLATION': 'utf8mb4_general_ci', + }, + }, + 'other': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME': 'django_other', + 'USER': 'django', + 'HOST': '127.0.0.1', + 'PASSWORD': 'secret', + 'TEST': { + 'CHARSET': 'utf8mb4', + 'COLLATION': 'utf8mb4_general_ci', + }, + } +} + +SECRET_KEY = "django_tests_secret_key" + +# Use a fast hasher to speed up tests. +PASSWORD_HASHERS = [ + 'django.contrib.auth.hashers.MD5PasswordHasher', +] From 8fcf7258e28be94187a2620040b7072b5cfe3dcb Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 7 Feb 2019 19:22:41 +0900 Subject: [PATCH 2/4] reduce verbosity --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9c120dbb..50c346a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,6 +53,6 @@ matrix: script: - cd django-1.11.18/tests/ - - ./runtests.py -v2 --parallel=1 --settings=test_mysql + - ./runtests.py --parallel=1 --settings=test_mysql # vim: sw=2 ts=2 sts=2 From 54a584f0a9260a326635c736ac1dd94c0ba5fde0 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 7 Feb 2019 19:28:21 +0900 Subject: [PATCH 3/4] Install time zone to MySQL --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 50c346a7..8b955bb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,6 +50,7 @@ matrix: before_script: - mysql -e 'create user django identified by "secret"' - mysql -e 'grant all on *.* to django' + - mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql script: - cd django-1.11.18/tests/ From 9262aa65453ffc3c6593eb7d4626af143d2773ea Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 7 Feb 2019 19:37:56 +0900 Subject: [PATCH 4/4] Add django_py3 --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8b955bb6..c7dfe890 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,8 @@ after_succes: matrix: include: - - python: "2.7" + - &django_py27 + python: "2.7" install: - pip install -U pip - wget https://github.com/django/django/archive/1.11.18.tar.gz @@ -56,4 +57,8 @@ matrix: - cd django-1.11.18/tests/ - ./runtests.py --parallel=1 --settings=test_mysql + - &django_py3 + <<: *django_py27 + python: "3.7" + # vim: sw=2 ts=2 sts=2