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

Avoid unnecessary warning about data reporting, when no data is reported #277

Merged
merged 1 commit into from
Jan 9, 2025
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
2 changes: 1 addition & 1 deletion rebench/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def output_as_str(string_like):

class UIError(Exception):

def __init__(self, message, exception):
def __init__(self, message, exception = None):
super(UIError, self).__init__()
self._message = message
self._exception = exception
Expand Down
14 changes: 14 additions & 0 deletions rebench/rebench.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,27 @@ def _report_completion(self):
success, _ = rebench_db.send_completion(get_current_time())
return success

@staticmethod
def _make_args_consistent(args):
if args.send_to_rebench_db and (args.no_execution or args.execution_plan):
raise UIError("Trying to send existing data with "
"--no-execution or --execution-plan set is not supported.\n")

if args.no_execution or args.execution_plan:
# no execution, so no need to report data
args.use_data_reporting = False

if args.no_execution and args.execution_plan:
raise UIError("Options --no-execution and --execution-plan are mutually exclusive.\n")

def run(self, argv=None):
if argv is None:
argv = sys.argv

data_store = DataStore(self.ui)
opt_parser = self.shell_options()
args = opt_parser.parse_args(argv[1:])
self._make_args_consistent(args)

cli_reporter = CliReporter(args.verbose, self.ui)

Expand Down
Loading