test: add simple push/pull/status test for aws

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2017-08-26 11:20:36 +03:00
parent 9d9a91d55d
commit f0ba4c1ff9
3 changed files with 50 additions and 0 deletions
+8
View File
@@ -16,6 +16,9 @@ BASE_DIR_S3=https://s3-$REGION.amazonaws.com/dataversioncontrol/functests
DATA_S3=$BASE_DIR_S3/stackoverflow_raw_small
CODE_S3=$BASE_DIR_S3/code
TEST_REPO_S3='dvc-test/myrepo'
TEST_REPO_REGION='us-east-2'
function dvc_print() {
echo -e "$1"
}
@@ -103,6 +106,11 @@ function dvc_create_repo() {
dvc import $DATA_CACHE/* data/xml
}
function dvc_clean_cloud_aws() {
dvc_info "Cleaning $TEST_REPO_S3"
aws s3 rm --recursive "s3://$TEST_REPO_S3/"
}
function dvc_check_dirs() {
for d in $1; do
if [ ! -d "$d" ]; then
+1
View File
@@ -6,6 +6,7 @@ source common.sh
TESTS+=" test-init.sh"
TESTS+=" test-import.sh"
TESTS+=" test-sync-aws.sh"
TESTS+=" test-repro-code.sh"
for t in $TESTS; do
+41
View File
@@ -0,0 +1,41 @@
#!/bin/bash
set -e
source common.sh
if [ -z $TRAVIS ]; then
dvc_create_repo
dvc_info "Setting up AWS cloud"
dvc_clean_cloud_aws
dvc config aws.storagepath $TEST_REPO_S3
dvc config aws.region $TEST_REPO_REGION
dvc_info "Checking status"
dvc status data/xml
dvc_info "Pushing to AWS"
dvc push data/xml
dvc_info "Checking status"
dvc status data/xml
dvc_info "Modifying data"
echo "123456" >> data/xml/Tags.xml
dvc_info "Checking status"
dvc status data/xml
dvc_info "Pulling data"
dvc pull data/xml
dvc_info "Checking status"
dvc status data/xml
dvc_clean_cloud_aws
else
dvc_info "AWS test is disabled for travis"
fi
dvc_pass