Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit a275724

Browse files
committed
CI: simplify test for prepare-workload
1 parent bf9dcef commit a275724

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- run:
99
name: Install software
1010
command: |
11-
apt-get update && apt-get install -y sudo wget jq \
11+
apt-get update && apt-get install -y sudo wget jq gawk pgreplay \
1212
&& wget get.docker.com -q -S -O - | sudo sh
1313
- checkout
1414
- setup_remote_docker

tests/nancy_prepare_workload.sh

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,15 @@
11
#!/bin/bash
22

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-
${BASH_SOURCE%/*}/../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 -y gawk # only Ubuntu/Debian! TODO
18-
19-
output=$( \
20-
${BASH_SOURCE%/*}/../nancy prepare-workload --db-name testci \
21-
--output ./test.replay ./.circleci/sample.log \
22-
2>&1
23-
)
24-
if [ "${output:0:33}" != "ERROR: pgreplay is not installed." ]; then
25-
failures=$((failures+1))
26-
echo "out: $output"
27-
fi
28-
29-
sudo apt-get install -y pgreplay # only Ubuntu/Debian! TODO
30-
313
output=$( \
324
${BASH_SOURCE%/*}/../nancy prepare-workload --db-name testci \
335
--output ./test.replay ./.circleci/sample.log \
346
2>&1
357
)
368
if [[ $output =~ "Total SQL statements processed: 2" ]]; then
37-
:
38-
else
39-
failures=$((failures+1))
40-
fi
41-
42-
if [ "$failures" -eq "0" ]; then
439
echo -e "\e[36mOK\e[39m"
4410
else
4511
>&2 echo -e "\e[31mFAILED\e[39m"
46-
>&2 echo -e "$failures/3 of checks failed"
12+
>&2 echo -e "Output: $output"
4713
exit 1
4814
fi
4915

0 commit comments

Comments
 (0)