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 +46
-3
lines changed Expand file tree Collapse file tree 3 files changed +46
-3
lines changed Original file line number Diff line number Diff line change 8
8
- run :
9
9
name : Install software
10
10
command : |
11
- apt-get update && apt-get install -y sudo wget jq pgreplay \
11
+ apt-get update && apt-get install -y sudo wget jq \
12
12
&& wget get.docker.com -q -S -O - | sudo sh
13
13
- checkout
14
14
- setup_remote_docker
Original file line number Diff line number Diff line change @@ -60,6 +60,18 @@ if [ -z ${OUTPUT+x} ]; then
60
60
exit 1;
61
61
fi
62
62
63
+ awk_version=$(( awk - Wversion 2 >/ dev/ null || awk -- version) | head - n1 )
64
+ if [ "${awk_version: 0: 3} " != "GNU" ]; then
65
+ >&2 echo "ERROR: GNU awk is required. Your awk version is: ${awk_version} . Try to install gawk."
66
+ exit 1 ;
67
+ fi
68
+
69
+ pgreplay_version=$(pgreplay -v 2 >/dev/null)
70
+ if [ "${pgreplay_version: 0: 8} " != "pgreplay" ]; then
71
+ >&2 echo "ERROR: pgreplay is not installed."
72
+ exit 1 ;
73
+ fi
74
+
63
75
cat $INPUT \
64
76
| sed -r 's/^([0 -9 ]{4 }-[0 -9 ]{2 }-[0 -9 ]{2 } [0 -9 ]{2 }:[0 -9 ]{2 }:[0 -9 ]{2 }\.[0 -9 ]{3 } .*)$/\nNANCY_NEW_LINE_SEPARATOR\n\1 /' \
65
77
| sed "s/\"\"/NANCY_TWO_DOUBLE_QUOTES_SEPARATOR/g" \
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- export PATH=$PATH :${BASH_SOURCE%/* } /..
3
+ # CAUTION: these checks will definitely not work on non-Debian(Ubuntu) machines,
4
+ # In general, all this script is very fragile. TODO improve
5
+
6
+ failures=0
7
+
8
+ output=$( \
9
+ nancy prepare-workload --db-name testci \
10
+ --output ./test.replay ./.circleci/sample.log \
11
+ 2>&1
12
+ )
13
+ if [ " ${output: 0: 27} " != " ERROR: GNU awk is required." ]; then
14
+ failures=$(( failures+ 1 ))
15
+ fi
16
+
17
+ sudo apt-get install gawk # only Ubuntu/Debian! TODO
4
18
5
19
output=$( \
6
20
nancy prepare-workload --db-name testci \
7
21
--output ./test.replay ./.circleci/sample.log \
8
22
2>&1
9
23
)
24
+ if [ " ${output: 0: 33} " != " ERROR: pgreplay is not installed." ]; then
25
+ failures=$(( failures+ 1 ))
26
+ echo " out: $output "
27
+ fi
10
28
29
+ sudo apt-get install pgreplay # only Ubuntu/Debian! TODO
30
+
31
+ output=$( \
32
+ nancy prepare-workload --db-name testci \
33
+ --output ./test.replay ./.circleci/sample.log \
34
+ 2>&1
35
+ )
11
36
if [[ $output =~ " Total SQL statements processed: 2" ]]; then
37
+ :
38
+ else
39
+ failures=$(( failures+ 1 ))
40
+ fi
41
+
42
+ if [ " $failures " -eq " 0" ]; then
12
43
echo -e " \e[36mOK\e[39m"
13
44
else
14
45
>&2 echo -e " \e[31mFAILED\e[39m"
15
- >&2 echo -e " Output: $output "
46
+ >&2 echo -e " $failures /3 of checks failed "
16
47
exit 1
17
48
fi
18
49
You can’t perform that action at this time.
0 commit comments