forked from pingcap/django-tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
django_test_suite.sh
executable file
·41 lines (35 loc) · 1.48 KB
/
django_test_suite.sh
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
#!/bin/bash
# Copyright 2021 PingCAP, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# See the License for the specific language governing permissions and
# limitations under the License.
set -x pipefail
# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
export DJANGO_TESTS_DIR="django_tests_dir"
mkdir -p $DJANGO_TESTS_DIR
pip3 install -e .
git clone --depth 1 --branch $DJANGO_VERSION https://github.com/django/django.git $DJANGO_TESTS_DIR/django
cp tidb_settings.py $DJANGO_TESTS_DIR/django/tidb_settings.py
cp tidb_settings.py $DJANGO_TESTS_DIR/django/tests/tidb_settings.py
cp -r ./tests/tidb/ $DJANGO_TESTS_DIR/django/tests/tidb/
cp -r ./tests/tidb_field_defaults/ $DJANGO_TESTS_DIR/django/tests/tidb_field_defaults/
cd $DJANGO_TESTS_DIR/django && pip3 install -e . && pip3 install -r tests/requirements/py3.txt && pip3 install -r tests/requirements/mysql.txt; cd ../../
cd $DJANGO_TESTS_DIR/django/tests
EXIT_STATUS=0
for DJANGO_TEST_APP in $DJANGO_TEST_APPS
do
python3 runtests.py $DJANGO_TEST_APP --noinput --settings tidb_settings || EXIT_STATUS=$?
if [[ $EXIT_STATUS -ne 0 ]]; then
exit $EXIT_STATUS
fi
done
exit $EXIT_STATUS