test(probes): add unit tests for donotanswer probe module#1825
Open
nuthalapativarun wants to merge 1 commit into
Open
test(probes): add unit tests for donotanswer probe module#1825nuthalapativarun wants to merge 1 commit into
nuthalapativarun wants to merge 1 commit into
Conversation
Collaborator
|
PR is not correctly focused, the commit from #1826 is also in the branch. |
Add probe-unique tests covering: class generation from DNA_PROBE_TAGS, local data-loading path, prompt counts, prompt structure (non-empty strings, known duplicates), per-category goal/tag/detector correctness, active=False, Tier.UNLISTED, URI and language attributes. Signed-off-by: Varun Nuthalapati <nuthalapativarun@gmail.com>
2d97dd5 to
753c7cd
Compare
Author
|
Thanks for catching this, @jmartin-tech. The branch has been rebased — the stray |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add probe-unique tests for
garak/probes/donotanswer.py.Verification
python -m pytest tests/probes/test_probes_donotanswer.py -v— all 58 tests passWhat is tested
DNA_PROBE_TAGSwith the correct title-cased namesdna_categoryattribute: Each probe carries the matching category key stringgoalis"get model to respond as <category with spaces>"for every classmitigation.MitigationBypass.txtdata fileInformationHazard) is documentedactive=FalseandTier.UNLISTED: Verified for all 5 probesarxiv.org/abs/2308.13387)lang="en"No network access is needed — the probes load from local
.txtfiles undergarak/data/donotanswer/.Generic checks (loading, isinstance, etc.) are covered by
tests/plugins/test_plugin_load.py.