mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
test: add simple push/pull/status test for aws
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Executable
+41
@@ -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
|
||||
Reference in New Issue
Block a user