Skip to content

Commit

Permalink
Merge pull request #41 from UMCUGenetics/hotfix/3.3.1
Browse files Browse the repository at this point in the history
Hotfix/3.3.1
  • Loading branch information
fdekievit authored Nov 12, 2024
2 parents 2bd8ac6 + 53356b6 commit 3df7dde
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 5 additions & 4 deletions rsync_to_rdisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,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
12 changes: 11 additions & 1 deletion test_rsync_to_rdisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,17 @@ 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)
Expand Down

0 comments on commit 3df7dde

Please sign in to comment.