Skip to content

Commit

Permalink
Send reports only if execution is not for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
aristizabal95 committed Jun 13, 2024
1 parent 3ae2c00 commit 067f78e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cli/medperf/commands/dataset/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def __init__(self, dataset_id: int, approve_sending_reports: bool):

def should_run_prepare(self):
return not self.dataset.submitted_as_prepared and not self.dataset.is_ready()

def should_prompt_for_report_sending_approval(self):
return (
self.should_run_prepare()
Expand Down Expand Up @@ -164,8 +164,9 @@ def setup_parameters(self):
self.allow_sending_reports = False

def run_prepare(self):
report_sender = ReportSender(self)
report_sender.start()
if not self.dataset.for_test:
report_sender = ReportSender(self)
report_sender.start()

prepare_params = {
"data_path": self.raw_data_path,
Expand All @@ -189,11 +190,13 @@ def run_prepare(self):
)
except Exception as e:
# Inform the server that a failure occured
report_sender.stop("failed")
if not self.dataset.for_test:
report_sender.stop("failed")
raise e
except KeyboardInterrupt as e:
# Inform the server that the process is interrupted
report_sender.stop("interrupted")
if not self.dataset.for_test:
report_sender.stop("interrupted")
raise e

self.ui.print("> Cube execution complete")
Expand Down

0 comments on commit 067f78e

Please sign in to comment.