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

Commit f2a6fbb

Browse files
dmiusDmitry
authored andcommitted
Gz + SQL dump tests added
1 parent b8d48cb commit f2a6fbb

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

.circleci/test.dump.gz

130 Bytes
Binary file not shown.

.circleci/test.dump.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
create table t1 as
2+
select i as id, random() val
3+
from generate_series(1, 1000000) _(i);
4+
5+
alter table t1 add primary key (id);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
thisDir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
4+
parentDir="$(dirname "$thisDir")"
5+
srcDir="$parentDir/.circleci"
6+
if [ ! -d "$srcDir/tmp" ]; then
7+
mkdir "$srcDir/tmp"
8+
fi
9+
nancyRun="$parentDir/nancy_run.sh"
10+
11+
output=$(
12+
$nancyRun --workload-custom-sql "file://$srcDir/custom.sql" \
13+
--db-dump-path "file://$srcDir/test.dump.gz" \
14+
--tmp-path $srcDir/tmp 2>&1
15+
)
16+
17+
if [[ $output =~ "Queries duration:" ]]; 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
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
thisDir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
4+
parentDir="$(dirname "$thisDir")"
5+
srcDir="$parentDir/.circleci"
6+
if [ ! -d "$srcDir/tmp" ]; then
7+
mkdir "$srcDir/tmp"
8+
fi
9+
nancyRun="$parentDir/nancy_run.sh"
10+
11+
output=$(
12+
$nancyRun --workload-custom-sql "file://$srcDir/custom.sql" \
13+
--db-dump-path "file://$srcDir/test.dump.sql" \
14+
--tmp-path $srcDir/tmp 2>&1
15+
)
16+
17+
if [[ $output =~ "Queries duration:" ]]; 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

0 commit comments

Comments
 (0)