Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOTFIX 3.3.1 fixed issue where a warning after an error did not propagate the error #40

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading