-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_testing.sh
executable file
·57 lines (50 loc) · 1.13 KB
/
start_testing.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
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
set -e
set -u
function run_once {
pushd ..
set +e
set +u
cargo test --features integration_test blockchain $2 -- --nocapture
if [ $? -ne 0 ]
then
popd
set -e
set -u
return
else
set -e
set -u
popd
fi
mkdir -p ./generated/backup
mkdir -p ./generated/stats
local -r DATE=$(date +"%y-%m-%d_%H-%M-%S_")
local -r PREFIX=$1
pipenv run python ./process_metrics.py
#for f in ./generated/processed_blockchain_test_*.json
#do
# FILENAME=$(basename $f)
# cp $f ./generated/backup/${PREFIX}_${DATE}${FILENAME}
#done
for f in ../stats*.log
do
FILENAME=$(basename $f)
mv ../$FILENAME ./generated/stats/${PREFIX}_${DATE}${FILENAME}
done
cp ./gen_averages.csv ./generated/backup/${PREFIX}_${DATE}gen_averages.csv
cp ./gen.csv ./generated/backup/${PREFIX}_${DATE}gen.csv
}
function main {
for i in {1..100}
do
run_once "$1" "$2"
done
}
if [ $# -eq 2 ]
then
echo not default
main "$1" "--jobs $2"
else
echo usage: $0 name_of_logs num_of_jobs
fi