Skip to content

TEST: Unit test speed up#1872

Merged
rlundeen2 merged 1 commit into
microsoft:mainfrom
rlundeen2:rlundeen2/test-instructions-update
Jun 1, 2026
Merged

TEST: Unit test speed up#1872
rlundeen2 merged 1 commit into
microsoft:mainfrom
rlundeen2:rlundeen2/test-instructions-update

Conversation

@rlundeen2
Copy link
Copy Markdown
Contributor

  • Add instructions so GHCP can run test suites faster

And did some low-hanging speed ups

  • Add num_templates=2 to 7 jailbreak attack generation tests that were iterating over all 165 templates just to check attack types. test_attack_generation_for_complex went from 6.09s to 0.09s.
  • Remove test_attack_generation_for_all (subset of other tests) and merge test_get_atomic_attacks_async_returns_attacks assertions into test_attack_runs_include_objectives (duplicate setup).
  • Update test.instructions.md to direct full test passes to make unit-test (parallelized) rather than invoking pytest directly.

Net: ~27%% faster full unit-test pass (147s -> 107s), no coverage lost.

…guidance

- Add num_templates=2 to 7 jailbreak attack generation tests that were iterating over all 165 templates just to check attack types. test_attack_generation_for_complex went from 6.09s to 0.09s.
- Remove test_attack_generation_for_all (subset of other tests) and merge test_get_atomic_attacks_async_returns_attacks assertions into test_attack_runs_include_objectives (duplicate setup).
- Update test.instructions.md to direct full test passes to make unit-test (parallelized) rather than invoking pytest directly.

Net: ~27%% faster full unit-test pass (147s -> 107s), no coverage lost.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rlundeen2 rlundeen2 enabled auto-merge June 1, 2026 18:22
@rlundeen2 rlundeen2 added this pull request to the merge queue Jun 1, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 1, 2026
@rlundeen2 rlundeen2 added this pull request to the merge queue Jun 1, 2026
Merged via the queue into microsoft:main with commit e6c6712 Jun 1, 2026
48 checks passed
@rlundeen2 rlundeen2 deleted the rlundeen2/test-instructions-update branch June 1, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants