63def setup_parser() -> ArgumentParser:
64 parser = ArgumentParser()
65 common = parser.add_argument_group("common")
66 common.add_argument("-e", "--extra", type=str, dest="extra_args", default="",
67 help="Define additional args to pass e.g. --preExec 'r2e':'...' ")
68 common.add_argument("-f", "--fast", action="store_true", dest="fast_mode", default=False,
69 help="""Fast option will run all q tests simultaneously,
70 such that it will run faster if you have 4 cpu core slots on which to run. Be
71 warned! Only recommended when running on a high performance machine, not
72 lxplus!""")
73 common.add_argument("-v", "--validation", action="store_true", dest="validation_only", default=False,
74 help=f"""Run validation only.
75 File output comparisons will only be performed against pre-defined
76 reference files stored in the directory
77 {references_CVMFS_path}
78 and performance comparison tests will not be run.""")
79 common.add_argument("--run-only", action="store_true", dest="run_only", default=False,
80 help="Run only the main command(s).")
81 common.add_argument("--checks-only", type=str, dest="unique_ID", nargs="?", default=None, const='local',
82 help="Re-run only the checks.")
83
84 advanced = parser.add_argument_group("advanced")
85 advanced.add_argument("--CI", action="store_true", dest="ci_mode", default=False,
86 help="Will not setup Athena - only for CI tests!")
87 advanced.add_argument("--threads", type=int, dest="threads", default=None,
88 help="Override the number of threads to run the test with.")
89 advanced.add_argument("--ref", type=str, dest="reference_release", default=None,
90 help="Define a particular reference release.")
91 advanced.add_argument("--val", type=str, dest="validation_release", default=None,
92 help="Define a particular validation release")
93 advanced.add_argument("--output-path", type=str, dest="validation_run_path", default="",
94 help="Specify the head directory for running the validation tests. The default is ${PWD}")
95 advanced.add_argument("--reference-path", type=str, dest="reference_run_path", default="",
96 help="Specify the head directory for running the reference tests. The default is /tmp/${USER}")
97 advanced.add_argument("-z", "--exclusion-lists", "--interest-lists", type=str, dest="diff_rules_path", default=None,
98 help="""Specify the directory that contains the lists of variables that will be omitted
99 while comparing the outputs. The default is ./ and the format of the files is
100 ${test}_${format}_diff-exclusion-list.txt, e.g. q445_AOD_diff-exclusion-list.txt or
101 ${test}_${format}_diff-interest-list.txt, e.g. q445_AOD_diff-interest-list.txt.
102 The file should contain one regexp per line.""")
103 advanced.add_argument("--no-output-checks", action="store_true", dest="disable_output_checks", default=False,
104 help="Disable output checks")
105 advanced.add_argument("--detailed-comparison", action="store_true", dest="detailed_comparison", default=False,
106 help="Detailed output comparison")
107
108 tests = parser.add_argument_group("tests")
109 tests.add_argument("-t", "--test", type=str, dest="test", default=None,
110 help="Specify a test to run. Supported options are: sim, overlay, pileup, reco")
111 tests.add_argument("-a", "--tag", type=str, dest="ami_tag", default=None,
112 help="Override the AMI tag of the test.")
113 tests.add_argument("-w", "--workflow", type=WorkflowType, dest="workflow", choices=list(WorkflowType), default=None,
114 help="Specify the workflow that is being run (required for AMI tags or if you want to run only one workflow)")
115 tests.add_argument("--dsid", type=str, dest="dsid", default=None,
116 help="Override the DSID of the test (only for generation).")
117
118
119 tests.add_argument("-g", "--gen", action="store_true", dest="generation", default=False,
120 help="Run generation test using Gen_tf.py")
121 tests.add_argument("-s", "--sim", action="store_true", dest="simulation", default=False,
122 help="Run simulation test using Sim_tf.py")
123 tests.add_argument("-o", "--overlay", action="store_true", dest="overlay", default=False,
124 help="Run overlay test using Overlay_tf.py")
125 tests.add_argument("-p", "--pileup", action="store_true", dest="pileup", default=False,
126 help="Run MC reconstruction chain with pile-up")
127 tests.add_argument("-r", "--reco", action="store_true", dest="reco", default=False,
128 help="Run MC reconstruction (in case the default execution also runs simulation)")
129 tests.add_argument("-d", "--derivation", action="store_true", dest="derivation", default=False,
130 help="Run derivation test using Derivation_tf.py")
131
132 return parser
133
134