-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtests.sh
executable file
·47 lines (36 loc) · 1.56 KB
/
tests.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
#!/bin/bash
set -e
CONDA_ROOT=/opt/conda/bin
ACTIVATE_CMD="source ${CONDA_ROOT}/activate"
ENV_NAME="drugex"
RUN_CMD="${ACTIVATE_CMD} && conda activate ${ENV_NAME}"
WD=`pwd`
# setting up environments
echo "Creating environment: ${ENV_NAME}"
bash -c "${ACTIVATE_CMD} && conda create -n ${ENV_NAME} python=${PYTHON_VERSION}"
echo "Installing drugex package..."
bash -c "${RUN_CMD} && pip install git+${DRUGEX_REPO}@${DRUGEX_REVISION}"
echo "Installing qsprpred package..."
bash -c "${RUN_CMD} && pip install git+${QSPRPRED_REPO}@${QSPRPRED_REVISION}"
echo "Checking for CUDA..."
bash -c "${RUN_CMD} && python -c 'import torch; print(torch.cuda.is_available())'"
echo "Checking for drugex version..."
bash -c "${RUN_CMD} && python -c 'import drugex; print(drugex.__version__)'"
echo "Checking for qsprpred version..."
bash -c "${RUN_CMD} && python -c 'import qsprpred; print(qsprpred.__version__)'"
# running tests
echo "Running unit tests..."
bash -c "${RUN_CMD} && python -m unittest discover drugex"
echo "Running CLI tests..."
git clone ${DRUGEX_REPO}
cd DrugEx
git checkout ${DRUGEX_REVISION}
cd testing/clitest
bash -c "${RUN_CMD} && ./test.sh"
echo "Installing tutorial dependencies..."
bash -c "${RUN_CMD} && pip install papyrus_structure_pipeline git+https://github.com/martin-sicho/papyrus-scaffold-visualizer.git@main mols2grid jupyterlab"
bash -c "${RUN_CMD} && pip install git+${QSPRPRED_REPO}@${QSPRPRED_REVISION}" # ensure version
echo "Running tutorials..."
cd "${WD}/DrugEx/tutorial"
bash -c "${RUN_CMD} && ./run_all.sh"
echo "All tests finished successfully. Exiting..."