"vscode:/vscode.git/clone" did not exist on "a4a7e02f5ff96fabff1a9fa4f09854303c9c9a0a"
task_unit_test.sh 1 KB
Newer Older
1
2
#!/bin/bash

VoVAllen's avatar
VoVAllen committed
3
4
. /opt/conda/etc/profile.d/conda.sh

5
6
7
8
9
10
function fail {
    echo FAIL: $@
    exit -1
}

function usage {
11
    echo "Usage: $0 backend device"
12
13
}

14
if [ $# -ne 2 ]; then
15
    usage
16
    fail "Error: must specify backend and device"
17
18
fi

Minjie Wang's avatar
Minjie Wang committed
19
export DGLBACKEND=$1
20
export DGLTESTDEV=$2
Minjie Wang's avatar
Minjie Wang committed
21
22
23
export DGL_LIBRARY_PATH=${PWD}/build
export PYTHONPATH=tests:${PWD}/python:$PYTHONPATH
export DGL_DOWNLOAD_DIR=${PWD}
VoVAllen's avatar
VoVAllen committed
24
25
export TF_FORCE_GPU_ALLOW_GROWTH=true

26
27
28
29
30
31
32
if [ $2 == "gpu" ] 
then
  export CUDA_VISIBLE_DEVICES=0
else
  export CUDA_VISIBLE_DEVICES=-1
fi

VoVAllen's avatar
VoVAllen committed
33
34
conda activate ${DGLBACKEND}-ci

35
python3 -m pip install pytest pyyaml pandas pydantic rdflib || EXIT /B 1
VoVAllen's avatar
VoVAllen committed
36
37
python3 -m pytest -v --junitxml=pytest_compute.xml tests/compute || fail "compute"
python3 -m pytest -v --junitxml=pytest_backend.xml tests/$DGLBACKEND || fail "backend-specific"
38

39
export OMP_NUM_THREADS=1
40
export DMLC_LOG_DEBUG=1
41
if [ $2 != "gpu" ]; then
42
    python3 -m pytest -v --capture=tee-sys --junitxml=pytest_distributed.xml tests/distributed/*.py || fail "distributed"
43
fi