-
Notifications
You must be signed in to change notification settings - Fork 7
/
dockerrun.bash
49 lines (39 loc) · 1.24 KB
/
dockerrun.bash
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
#!/bin/bash
# This script sets up the poetry environment for running tests
# against a local build of a dictionary repo.
# This will remove the default gdcdictionary (eg, version 2.0.0)
# and install the local dictionary (eg, version 0.0.0).
#
# Similar to
# https://github.com/uc-cdis/.github/blob/master/.github/workflows/dictionary_push.yaml
cd /dictionary
if [ -f pyproject.toml ]; then
export USE_POETRY=1
else
export USE_POETRY=0
fi
echo "Removing old dictionaryutils"
rm -rf build dictionaryutils dist gdcdictionary.egg-info
echo "Installing dictionary"
if [ $USE_POETRY -eq 1 ]; then
echo "Via poetry"
poetry install -v --all-extras --no-interaction || true
fi
cp -r /dictionaryutils .
cd /dictionary/dictionaryutils
echo "Removing old gdcdictionary"
if [ $USE_POETRY -eq 1 ]; then
poetry run pip uninstall -y gen3dictionary
poetry run pip uninstall -y gdcdictionary
else
poetry remove gdcdictionary
poetry run pip uninstall -y gen3dictionary
fi
echo "Reinstall dictionary"
poetry run pip install ..
echo "The following schemas from dictionary will be tested:"
ls `poetry run python -c "from gdcdictionary import SCHEMA_DIR; print(SCHEMA_DIR)"`
echo "Ready to run tests"
poetry run pytest -v tests
export SUCCESS=$?
exit $SUCCESS