Skip to content
Open
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
14 changes: 14 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,20 @@ def test_site_yaml_overrides_max_workers(capsys):
assert exc_info.value.code == 1


# a run with parallel_attempts set should complete without error, for both the
# serial case (1) and a parallel case (>1). uses the cheap CPU-only test
# generator and the multi-prompt test.Test probe so that the >1 case actually
# reaches the multiprocessing path in garak.probes.base.Probe._execute_all
@pytest.mark.parametrize("parallel_attempts", [1, 4])
Comment thread
leondz marked this conversation as resolved.
def test_parallel_attempts_run_completes(parallel_attempts):
args = (
f"--parallel_attempts {parallel_attempts} -m test.Blank -p test.Test -g 1"
).split()
garak.cli.main(args)

assert _config.system.parallel_attempts == parallel_attempts
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asserts should have a message describing the desired condition. e.g. "--parallel_atempts cli param should pass through to _config.system"



model_target_data = [
("model_type", "model_name"),
("model_type", "target_name"),
Expand Down
Loading