Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
test: fix s3 integration test (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
glorv authored Jan 25, 2021
1 parent 90dbfe3 commit a098961
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions tests/s3/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
[mydumper]
data-source-dir = "s3://test-bucket/?endpoint=http%3A//127.0.0.1%3A9000&access_key=s3accesskey&secret_access_key=s3secretkey&force_path_style=true"
14 changes: 9 additions & 5 deletions tests/s3/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ stop_minio() {
}
trap stop_minio EXIT

echo 'CREATE DATABASE ch;' > "$DBPATH/$DB-schema-create.sql"
echo "CREATE TABLE t(i INT, s varchar(32));" > "$DBPATH/$DB.$TABLE-schema.sql"
echo 'INSERT INTO tbl (i, s) VALUES (1, "1"),(2, "test2"), (3, "qqqtest");' > "$DBPATH/$DB.$TABLE.sql"
cat > "$DBPATH/$DB.$TABLE.0.csv" << _EOF_
BUCKET=test-bucket
DATA_PATH=$DBPATH/$BUCKET
mkdir -p $DATA_PATH
echo 'CREATE DATABASE s3_test;' > "$DATA_PATH/$DB-schema-create.sql"
echo "CREATE TABLE t(i INT, s varchar(32));" > "$DATA_PATH/$DB.$TABLE-schema.sql"
echo 'INSERT INTO tbl (i, s) VALUES (1, "1"),(2, "test2"), (3, "qqqtest");' > "$DATA_PATH/$DB.$TABLE.sql"
cat > "$DATA_PATH/$DB.$TABLE.0.csv" << _EOF_
i,s
100,"test100"
101,"\""
Expand All @@ -64,7 +67,8 @@ _EOF_
run_sql "DROP DATABASE IF EXISTS $DB;"
run_sql "DROP TABLE IF EXISTS $DB.$TABLE;"

run_lightning -d "$DBPATH" --backend local 2> /dev/null
SOURCE_DIR="s3://$BUCKET/?endpoint=http%3A//127.0.0.1%3A9900&access_key=$MINIO_ACCESS_KEY&secret_access_key=$MINIO_SECRET_KEY&force_path_style=true"
run_lightning -d $SOURCE_DIR --backend local 2> /dev/null
run_sql "SELECT count(*), sum(i) FROM \`$DB\`.$TABLE"
check_contains "count(*): 7"
check_contains "sum(i): 413"

0 comments on commit a098961

Please sign in to comment.