rapids/tests/scripts/run_tests.sh

34 lines
1.1 KiB
Bash
Raw Normal View History

2020-06-05 18:46:36 +02:00
#!/bin/bash
# Commmands necessary to setup and run the tests for RAPIDS
echo Setting up for testing...
2020-06-25 22:32:45 +02:00
# Uncomment the section below if neccessary to remove old files when testing locally
# echo deleting old data...
# rm -rf data/raw/*
# rm -rf data/processed/*
# rm -rf data/interim/*
# rm -rf data/external/test*
echo Copying files...
2020-06-05 18:46:36 +02:00
cp -r tests/data/raw/* data/raw
cp tests/data/external/* data/external
2020-06-25 22:32:45 +02:00
# Uncomment the section below to backup snakemake file when testing locally
# echo Backing up preprocessing...
# cp rules/preprocessing.snakefile bak
echo Disabling downloading of dataset...
2020-06-05 18:46:36 +02:00
sed -e '10,20 s/^/#/' -e 's/rules.download_dataset.output/"data\/raw\/\{pid\}\/\{sensor\}_raw\.csv"/' rules/preprocessing.snakefile > tmp
cp tmp rules/preprocessing.snakefile
2020-06-25 22:32:45 +02:00
echo Running RAPIDS Pipeline on testdata...
snakemake --profile tests/settings
echo Running tests on data produced...
2020-06-25 22:32:45 +02:00
python -m unittest discover tests/scripts/ -v
# Uncomment to return snakemake back to the original version when testing locally
# echo Cleaning up...
# mv bak rules/preprocessing.snakefile
# rm tmp