-
Notifications
You must be signed in to change notification settings - Fork 22
/
test.sh
61 lines (50 loc) · 1.8 KB
/
test.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# Copyright 2019 The Johns Hopkins University Applied Physics Laboratory
#
# 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,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Uses test_versions.txt and Python virtualenvs to run the library tests
# against multiple versions of Django and Django Rest Framework
set -e
#set -x
# Check for virtualenv
if [ -z "`which virtualenv 2> /dev/null`" ] ; then
echo "virtualenv not available"
exit 1
fi
if [ -d bin/ ] ; then
echo "virtualenv already exists, cannot continue"
exit 1
fi
while read line ; do
if [[ $line == \#* ]] ; then
continue
fi
django="`echo $line | cut -d' ' -f1`"
drf="`echo $line | cut -d' ' -f2`"
echo "Django $django DRF $drf"
# TODO set python version
virtualenv . --always-copy
source bin/activate
# Need to manually install our custom django-oidc and drf-oidc-auth
# because setuptools doesn't support PEP 508 yet
pip install Django==$django \
djangorestframework==$drf \
git+http://github.com/jhuapl-boss/django-oidc.git\#egg=django-oidc \
git+http://github.com/jhuapl-boss/drf-oidc-auth.git\#egg=drf-oidc-auth
python setup.py test > test_results_${django}_${drf}.txt 2>&1
deactivate
rm -r bin/
rm -r include/
rm -r lib/
rm pip-selfcheck.json
done < test_versions.txt