Files
dvc/functest/common.sh
T
Ruslan Kuprieiev e7bf8054da functest: fix existing scripts
A few minor adjustments to make what we currently have work,
while I prepare new func tests.

Fixes #175

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2017-08-20 04:53:13 +03:00

39 lines
740 B
Bash

#!/bin/bash
set -e
BASE_DIR_S3=https://s3-us-west-2.amazonaws.com/dataversioncontrol/functests
RAW_DATA_S3=$BASE_DIR_S3/stackoverflow_raw_small
RAW_DATA_LOCAL=sync_raw_data
CODE_LOCAL=sync_code
TEST_REPO=repo_test
function dvc_info() {
echo "=============== DVC test: $1 ==============="
}
function _init_repo() {
dvc_info 'init reporitory'
git init
dvc init
dvc_info 'import xml files'
mkdir data/xml
dvc import ../$RAW_DATA_LOCAL/* data/xml
dvc_info 'copy code'
mkdir code
cp ../$CODE_LOCAL/* code/
git add code/
git commit -m 'Add code'
}
function create_repo() {
dvc_info 'create reporitory'
rm -rf $TEST_REPO
mkdir $TEST_REPO
(cd $TEST_REPO && _init_repo)
}