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

Commit

Permalink
fix(reg): Fix regression test CI executing errors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
howjmay committed May 9, 2019
1 parent 8620253 commit d5054bb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env bash

git fetch origin develop
git checkout -b pullrequest FETCH_HEAD

make

bazel run //accelerator &
Expand Down
8 changes: 8 additions & 0 deletions tests/regression/1_close_TA.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

wait $(ps aux | grep '[r]unner.py' | awk '{print $2}')
kill $(ps aux | grep '[.]/accelerator' | awk '{print $2}')
wait $!

trap 'exit 0' SIGTERM

8 changes: 8 additions & 0 deletions tests/regression/1_run_TA.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
make

bazel run //accelerator &
TA_pid=$!
sleep 20

pip install --user -r tests/regression/requirements.txt

25 changes: 0 additions & 25 deletions tests/regression/1_run_regression_test.sh

This file was deleted.

1 change: 0 additions & 1 deletion tests/regression/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
numpy==1.14.2
requests==2.20.0
9 changes: 6 additions & 3 deletions tests/regression/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import subprocess
import unittest
import numpy as np
import statistics
import time

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


def eval_stat(time_cost, func_name):
avg = np.average(time_cost)
var = np.var(time_cost)
avg = statistics.mean(time_cost)
var = statistics.variance(time_cost)
print("Average Elapsed Time of " + str(func_name) + ":" + str(avg) +
" sec")
print("With the range +- " + str(2 * var) +
Expand Down Expand Up @@ -207,3 +207,6 @@ def test_mam_recv_msg(self):
] # 'private' methods start from _
for method in public_method_names:
getattr(f, method)() # call

if not unittest.TestResult().errors:
exit(1)

0 comments on commit d5054bb

Please sign in to comment.