Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit d5054bb

Browse files
committed
fix(reg): Fix regression test CI executing errors
Remove errors related git commands, and `1_run_regression_test.sh` which would cause no error message showed in CI even unittest failed in regression test. Since there is importing issue of mudule `numpy`, we should use module `statistics` as alternative solution.
1 parent 8620253 commit d5054bb

File tree

6 files changed

+22
-32
lines changed

6 files changed

+22
-32
lines changed

tests/regression/0_pull_build.sh renamed to tests/regression/0_build.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env bash
22

3-
git fetch origin develop
4-
git checkout -b pullrequest FETCH_HEAD
5-
63
make
74

85
bazel run //accelerator &

tests/regression/1_close_TA.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
wait $(ps aux | grep '[r]unner.py' | awk '{print $2}')
4+
kill $(ps aux | grep '[.]/accelerator' | awk '{print $2}')
5+
wait $!
6+
7+
trap 'exit 0' SIGTERM
8+

tests/regression/1_run_TA.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
make
2+
3+
bazel run //accelerator &
4+
TA_pid=$!
5+
sleep 20
6+
7+
pip install --user -r tests/regression/requirements.txt
8+

tests/regression/1_run_regression_test.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/regression/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
numpy==1.14.2
21
requests==2.20.0

tests/regression/runner.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
import subprocess
66
import unittest
7-
import numpy as np
7+
import statistics
88
import time
99

1010
if len(sys.argv) == 2:
@@ -23,8 +23,8 @@
2323

2424

2525
def eval_stat(time_cost, func_name):
26-
avg = np.average(time_cost)
27-
var = np.var(time_cost)
26+
avg = statistics.mean(time_cost)
27+
var = statistics.variance(time_cost)
2828
print("Average Elapsed Time of " + str(func_name) + ":" + str(avg) +
2929
" sec")
3030
print("With the range +- " + str(2 * var) +
@@ -207,3 +207,6 @@ def test_mam_recv_msg(self):
207207
] # 'private' methods start from _
208208
for method in public_method_names:
209209
getattr(f, method)() # call
210+
211+
if not unittest.TestResult().errors:
212+
exit(1)

0 commit comments

Comments
 (0)