Skip to content

Commit

Permalink
Merge pull request #40 from UMCUGenetics/hotfix/3.3.1
Browse files Browse the repository at this point in the history
HOTFIX 3.3.1 fixed issue where a warning after an error did not propagate the error
  • Loading branch information
fdekievit authored Nov 12, 2024
2 parents a4d4c15 + 10a44af commit e006f21
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
9 changes: 5 additions & 4 deletions rsync_to_rdisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,14 @@ def run_vcf_upload(vcf_file, vcf_type, run):


def get_upload_state(upload_result):
return_value = 'ok'
for msg in upload_result:
if 'error' in msg.lower():
return 'error'
return_value = 'error'
break
elif 'warning' in msg.lower():
return 'warning'
return 'ok'

return_value = 'warning'
return return_value

def upload_gatk_vcf(run, run_folder):
# Remove projects from run
Expand Down
14 changes: 12 additions & 2 deletions test_rsync_to_rdisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,18 @@ def test_run_vcf_upload(mocker, set_up_test):
(["warning"], "warning"),
(["Warning"], "warning"),
(["vcf_upload_warning"], "warning"),
(["ok"], "ok")
])
(["ok"], "ok"),
(["error", "error"], "error"),
(["warning", "warning"], "warning"),
(["error", "warning"], "error"),
(["warning", "error"], "error"),
(["warning", "ok"], "warning"),
(["ok", "warning"], "warning"),
(["warning", "error", "ok"], "error"),
(["ok", "warning", "ok", "error"], "error"),
(["ok", "warning", "error"], "error"),
(["ok", "error", "warning"], "error")
])
def test_get_upload_state(msg, expected):
return_state = rsync_to_rdisc.get_upload_state(msg)
assert return_state == expected
Expand Down

0 comments on commit e006f21

Please sign in to comment.