@@ -79,11 +79,11 @@ def make_basic_run(
7979 annotators : List [str ],
8080 hazard_tests : Dict [str , List [str ]],
8181 calibration = False ,
82+ benchmark = "official" ,
8283) -> FakeJournal :
8384 """Successful "fresh" benchmark run with all SUT/annotator responses fetched (not cached).
8485 Measurements/annotations are all safe.
8586 Each hazard uses all tests."""
86- benchmark = "official"
8787 journal = FakeJournal ()
8888 start_message = "starting calibration run" if calibration else "starting run"
8989 journal .append (
@@ -374,21 +374,44 @@ def test_annotations_merged_correctly(tmp_path, basic_benchmark_run):
374374 assert subchecker .results [failed_row ][subchecker ._col_name (AnnotationsMergedCorrectly )] is True
375375
376376
377- def test_annotations_merged_correctly_fails_with_one_annotator (tmp_path ):
377+ @pytest .mark .parametrize ("annotator_type,expected" , (["default" , True ], ["ensemble" , False ]))
378+ def test_general_benchmark_annotations_merged_correctly_fails_with_singleton_ensemble (
379+ tmp_path , annotator_type , expected
380+ ):
378381 # Simulate run with only 1 annotator.
379382 run = make_basic_run (
380383 suts = ["sut1" ],
381384 test_prompts = {"test1" : ["prompt1" ]},
382385 annotators = ["annotator1" ],
383386 hazard_tests = {"hazard1" : ["test1" ]},
387+ benchmark = f"official-{ annotator_type } " ,
384388 )
385389 checker = init_checker_for_journal (tmp_path , run )
386390 checker .run ()
387391
388392 subchecker = checker .test_sut_level_checker
389393 failed_row = subchecker ._row_key (sut = "sut1" , test = "test1" )
390394 assert subchecker .check_is_complete ()
391- assert subchecker .results [failed_row ][subchecker ._col_name (AnnotationsMergedCorrectly )] is False
395+ assert subchecker .results [failed_row ][subchecker ._col_name (AnnotationsMergedCorrectly )] is expected
396+
397+
398+ @pytest .mark .parametrize ("annotator_type" , (["default" ], ["ensemble" ]))
399+ def test_security_benchmark_annotations_merged_correctly_passes_with_singleton_ensemble (tmp_path , annotator_type ):
400+ # Simulate run with only 1 annotator.
401+ run = make_basic_run (
402+ suts = ["sut1" ],
403+ test_prompts = {"test1" : ["prompt1" ]},
404+ annotators = ["annotator1" ],
405+ hazard_tests = {"hazard1" : ["test1" ]},
406+ benchmark = f"security-{ annotator_type } " ,
407+ )
408+ checker = init_checker_for_journal (tmp_path , run )
409+ checker .run ()
410+
411+ subchecker = checker .test_sut_level_checker
412+ failed_row = subchecker ._row_key (sut = "sut1" , test = "test1" )
413+ assert subchecker .check_is_complete ()
414+ assert subchecker ._col_name (AnnotationsMergedCorrectly ) not in subchecker .results [failed_row ]
392415
393416
394417def test_annotations_merged_correctly_false_safe (tmp_path , basic_benchmark_run ):
0 commit comments