@@ -280,6 +280,8 @@ def warn(msg: str):
280280 self .is_get_tests_from_guess = is_get_tests_from_guess
281281 self .use_case = use_case
282282
283+ self ._validate_print_input_snapshot_option_enabled ()
284+
283285 self .file_path_normalizer = FilePathNormalizer (base_path , no_base_path_inference = no_base_path_inference )
284286
285287 self .test_paths : list [list [dict [str , str ]]] = []
@@ -599,6 +601,41 @@ def _should_skip_stdin(self) -> bool:
599601 return True
600602 return False
601603
604+ def _validate_print_input_snapshot_option (self ):
605+ if not self .print_input_snapshot_id :
606+ return
607+
608+ conflicts : list [str ] = []
609+ option_checks = [
610+ ("--target" , self .target is not None ),
611+ ("--time" , self .time is not None ),
612+ ("--confidence" , self .confidence is not None ),
613+ ("--goal-spec" , self .goal_spec is not None ),
614+ ("--rest" , self .rest is not None ),
615+ ("--bin" , self .bin_target is not None ),
616+ ("--same-bin" , bool (self .same_bin_files )),
617+ ("--ignore-new-tests" , self .ignore_new_tests ),
618+ ("--ignore-flaky-tests-above" , self .ignore_flaky_tests_above is not None ),
619+ ("--prioritize-tests-failed-within-hours" , self .prioritize_tests_failed_within_hours is not None ),
620+ ("--prioritized-tests-mapping" , self .prioritized_tests_mapping_file is not None ),
621+ ("--get-tests-from-previous-sessions" , self .is_get_tests_from_previous_sessions ),
622+ ("--get-tests-from-guess" , self .is_get_tests_from_guess ),
623+ ("--output-exclusion-rules" , self .is_output_exclusion_rules ),
624+ ("--non-blocking" , self .is_non_blocking ),
625+ ]
626+
627+ for option_name , is_set in option_checks :
628+ if is_set :
629+ conflicts .append (option_name )
630+
631+ if conflicts :
632+ conflict_list = ", " .join (conflicts )
633+ print_error_and_die (
634+ f"--print-input-snapshot-id cannot be used with { conflict_list } ." ,
635+ self .tracking_client ,
636+ Tracking .ErrorEvent .USER_ERROR ,
637+ )
638+
602639 def _print_input_snapshot_id_value (self , subset_result : SubsetResult ):
603640 if not subset_result .subset_id :
604641 raise click .ClickException (
0 commit comments