This repository was archived by the owner on Aug 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +49
-26
lines changed Expand file tree Collapse file tree 3 files changed +49
-26
lines changed Original file line number Diff line number Diff line change 1
1
.circleci /tmp
2
- . /* .json
3
- . /* .gz
2
+ docker /tmp
3
+ * .gz
4
+ * .json
Original file line number Diff line number Diff line change @@ -8,43 +8,41 @@ case "$1" in
8
8
echo -e "
9
9
\033[1mDESCRIPTION\033[22m
10
10
11
- The Nancy Command Line Interface is a unified way to manage
12
- database experiments.
11
+ The Nancy Command Line Interface is a unified way to manage database
12
+ experiments.
13
13
14
- Nancy is a member of Postgres.ai's Artificial DBA team
15
- responsible for conducting experiments.
14
+ Nancy is a member of Postgres.ai's Artificial DBA team responsible for
15
+ conducting experiments.
16
16
17
17
\033[1mSYNOPSYS\033[22m
18
18
19
- nancy <command> [parameters]
19
+ nancy <command> [parameters]
20
20
21
21
\033[1mAVAILABLE COMMANDS\033[22m
22
22
23
23
* help
24
24
25
- * prepare-database
25
+ * prepare-database (WIP)
26
26
27
27
* prepare-workload
28
28
29
29
* run
30
- " | less -RFX
31
- exit 1;
32
- ;;
33
- * )
34
- word=" ${1/ -/ _} "
35
- if [ ! -f " ${BASH_SOURCE%/* } /nancy_$word .sh" ]
36
- then
37
- >&2 echo " ERROR: Unknown command."
38
- >&2 echo " Try 'nancy help'"
39
- exit 1;
40
- fi
41
- cmd=" ${BASH_SOURCE%/* } /nancy_$word .sh"
42
- shift ;
43
- ;;
30
+ " | less -RFX
31
+ exit 1;
32
+ ;;
33
+ * )
34
+ word=" ${1/ -/ _} "
35
+ if [[ ! -f " ${BASH_SOURCE%/* } /nancy_$word .sh" ]]; then
36
+ >&2 echo " ERROR: Unknown command: $word ."
37
+ >&2 echo " Try 'nancy help'"
38
+ exit 1
39
+ fi
40
+ cmd=" ${BASH_SOURCE%/* } /nancy_$word .sh"
41
+ shift ;
42
+ ;;
44
43
esac
45
44
46
- while [ -n " $1 " ]
47
- do
45
+ while [ -n " $1 " ]; do
48
46
if [ " $1 " == " --debug" ]; then
49
47
DEBUG=1
50
48
fi
56
54
shift
57
55
done
58
56
59
- [ " $DEBUG " -eq " 1" ] && echo " CMD: $cmd "
57
+ [[ " $DEBUG " -eq " 1" ]] && echo " CMD: $cmd "
60
58
61
- eval $cmd
59
+ eval " $cmd "
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ realpath () {
4
+ [[ $1 = /* ]] && echo " $1 " || echo " $PWD /${1# ./ } "
5
+ }
6
+
7
+ src_dir=$( dirname $( dirname $( realpath " $0 " ) ) ) " /.circleci"
8
+
9
+ output=$(
10
+ ${BASH_SOURCE%/* } /../nancy run \
11
+ --db-dump " create table t1 as select * from generate_series(1, 1000);" \
12
+ --workload-custom-sql " select count(*) from t1;" \
13
+ --tmp-path $src_dir /tmp 2>&1
14
+ )
15
+
16
+ regex=" Errors:[[:blank:]]*0"
17
+ if [[ $output =~ $regex ]]; then
18
+ echo -e " \e[36mOK\e[39m"
19
+ else
20
+ >&2 echo -e " \e[31mFAILED\e[39m"
21
+ >&2 echo -e " Output: $output "
22
+ exit 1
23
+ fi
24
+
You can’t perform that action at this time.
0 commit comments