From 6f41978b13895a6c0517bce92c9da533d50413c6 Mon Sep 17 00:00:00 2001 From: Guillermo Lara Date: Tue, 30 Jul 2024 08:46:22 +0000 Subject: [PATCH] Add no-validate flag to scheduler --- support/Python/Schedule.py | 16 ++++++++++++---- tests/support/Python/Test_Schedule.py | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/support/Python/Schedule.py b/support/Python/Schedule.py index 28094f1e84b61..e61de0ab1baa9 100644 --- a/support/Python/Schedule.py +++ b/support/Python/Schedule.py @@ -142,6 +142,7 @@ def schedule( submit: Optional[bool] = None, clean_output: bool = False, force: bool = False, + no_validate=False, extra_params: dict = {}, **kwargs, ) -> Optional[subprocess.CompletedProcess]: @@ -541,10 +542,12 @@ def schedule( force=force, ) - # Validate input file - validate_input_file( - input_file_path.resolve(), executable=executable, work_dir=run_dir - ) + if not no_validate: + # Validate input file + validate_input_file( + input_file_path.resolve(), executable=executable, work_dir=run_dir + ) + # - If the input file may request resubmissions, make sure we have a # segments directory metadata, input_file = yaml.safe_load_all(rendered_input_file) @@ -854,6 +857,11 @@ def scheduler_options(f): "You may also want to use '--clean-output'." ), ) + @click.option( + "--no-validate", + is_flag=True, + help="Skip validation of the input file.", + ) # Scheduling options @click.option( "--scheduler", diff --git a/tests/support/Python/Test_Schedule.py b/tests/support/Python/Test_Schedule.py index 4db7c57c7c320..154d1935305cd 100644 --- a/tests/support/Python/Test_Schedule.py +++ b/tests/support/Python/Test_Schedule.py @@ -230,6 +230,7 @@ def test_schedule(self): extra_option="TestOpt", metadata_option="MetaOpt", force=False, + no_validate=False, input_file="InputFile.yaml", input_file_name="InputFile.yaml", input_file_template=str(self.test_dir / "InputFile.yaml"),