unittest.sh 1.12 KB
Newer Older
1
#!/bin/bash
2
set -e
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CWD=${PWD}

# -------------For python unittest-------------

## ------Run annotation test------
echo ""
echo "===========================Testing: nni_annotation==========================="
cd ${CWD}/../tools/
python3 -m unittest -v nni_annotation/test_annotation.py

## Export certain environment variables for unittest code to work
export NNI_TRIAL_JOB_ID=test_trial_job_id
export NNI_PLATFORM=unittest

## ------Run sdk test------
echo ""
echo "===========================Testing: nni_sdk==========================="
cd ${CWD}/../src/sdk/pynni/
python3 -m unittest discover -v tests

23
# -------------For typescript unittest-------------
24
25
26
cd ${CWD}/../src/nni_manager
echo ""
echo "===========================Testing: nni_manager==========================="
27
npm run test
chicm-ms's avatar
chicm-ms committed
28

29
30
31
32
33
34
# -------------For NASUI unittest-------------
cd ${CWD}/../src/nasui
echo ""
echo "===========================Testing: nasui==========================="
CI=true npm test

chicm-ms's avatar
chicm-ms committed
35
36
37
38
39
## ------Run nnictl unit test------
echo ""
echo "===========================Testing: nnictl==========================="
cd ${CWD}/../tools/nni_cmd/
python3 -m unittest discover -v tests