diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..d7155bfd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,34 @@ +language: python +python: + - "3.7" + +before_install: + - R -e 'install.packages(c( "rmarkdown"), repos = "http://cran.us.r-project.org")' + +before_script: + # Install Packrat + - snakemake packrat_install + - snakemake packrat_init + - snakemake packrat_restore + +install: + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; + - bash miniconda.sh -b -p $HOME/miniconda + - source "$HOME/miniconda/bin:$PATH" + - hash -r + - conda config --set always_yes yes --set changeps1 no + - conda update -q conda + # Useful for debugging any issues with conda + - conda info -a + + # Replace dep1 dep2 ... with your dependencies + - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION --file environment.yml + - conda activate test-environment + +services: + - mysql + +script: + - cp -r tests/data/raw/* data/raw + - snakemake --profile tests/settings -R sensor_features + - ./env/bin/python -m unittest discover tests/scripts/ -v \ No newline at end of file diff --git a/tests/scripts/utils.py b/tests/scripts/utils.py index ca8c9e16..37fdc0be 100644 --- a/tests/scripts/utils.py +++ b/tests/scripts/utils.py @@ -58,8 +58,7 @@ def generate_file_list(configs, sensor): if 'TYPES' in configs[sensor_cap]: for each in configs[sensor_cap]['TYPES']: sensor_type.append(each+'_') - - + act_file_list = expand(act_str,pid=configs["PIDS"], sensor = sensor, sensor_type = sensor_type, @@ -77,7 +76,7 @@ def generate_sensor_file_lists(configs): # Go through the configs and select those sensors with DAY_SEGMENTS, # optionally TYPES then create expected files Return dictionary with # list of file paths of expected and actual files for each sensor - # listed in the config file. + # listed in the config file. Added for Travis. # Initialize string of file path for both expected and actual metric values act_str = "data/processed/{pid}/{sensor}_{sensor_type}{day_segment}.csv"