-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated test_downloadable to properly check if regimen already tracked
- Loading branch information
Showing
7 changed files
with
96 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export PATH=${bamboo_build_working_directory}/miniconda/bin:$PATH | ||
export HOME=${bamboo_build_working_directory}/.home | ||
export TMPDIR=${bamboo_build_working_directory} | ||
export CONDA_PATH_BACKUP=${CONDA_PATH_BACKUP:-$PATH} | ||
export CONDA_PREFIX=${CONDA_PREFIX:-} | ||
export CONDA_PS1_BACKUP=${CONDA_PS1_BACKUP:-} | ||
|
||
source activate ${bamboo_build_working_directory}/.conda/conda_test_env | ||
cd ${bamboo_build_working_directory} | ||
coverage run --source ./ -m pytest --junitxml=test-reports/tests.xml --html=test-reports/report.html --self-contained-html | ||
coverage html --omit="tests/*,setup.py" --directory=htmlcov | ||
source deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
set -eu | ||
|
||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh | ||
bash miniconda.sh -b -p ${bamboo_build_working_directory}/miniconda | ||
export PATH=${bamboo_build_working_directory}/miniconda/bin:$PATH | ||
export HOME=${bamboo_build_working_directory}/.home | ||
export TMPDIR=${bamboo_build_working_directory} | ||
export CONDA_PATH_BACKUP=${CONDA_PATH_BACKUP:-$PATH} | ||
export CONDA_PREFIX=${CONDA_PREFIX:-} | ||
export CONDA_PS1_BACKUP=${CONDA_PS1_BACKUP:-} | ||
conda create -y -v --prefix ${bamboo_build_working_directory}/.conda/conda_test_env python=3.6 | ||
source activate ${bamboo_build_working_directory}/.conda/conda_test_env | ||
cd ${bamboo_build_working_directory} | ||
pip install -r requirements.txt | ||
pip install -r requirements_dev.txt | ||
source deactivate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pyyaml | ||
requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pytest | ||
bumpversion | ||
flake8 | ||
pytest-cov | ||
pytest-html | ||
coverage | ||
pandas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
from .utils import load_regimen | ||
|
||
regimen_data = load_regimen() | ||
|
||
def test_stage_name_in_params(): | ||
for stage_name, stage_dict in regimen_data['stages'].items(): | ||
def test_stage_name_in_params(regimen_dict): | ||
for stage_name, stage_dict in regimen_dict['stages'].items(): | ||
stage_param = stage_dict['parameters']['stage'] | ||
assert stage_param==stage_name, "stage: {}, param: {}".format(stage_name,stage_param) | ||
|
||
def test_transitions_stages_match(regimen_dict): | ||
|
||
# Double-check regimen stages and transitions match: | ||
transition_source_target_set = set() | ||
for t in regimen_dict['transitions']: | ||
transition_source_target_set.add(t['source']) | ||
transition_source_target_set.add(t['dest']) | ||
stage_set = set(regimen_dict['stages'].keys()) | ||
if not all([curr_stage in stage_set for curr_stage in transition_source_target_set]): | ||
raise Exception('Stages and source/dest of transitions are not consistent') |