-
Notifications
You must be signed in to change notification settings - Fork 491
test(content_safety): add tests for content safety actions #1240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a suite of tests for content safety actions to verify the tuple unpacking behavior introduced in #1207 and to validate proper error handling for missing or incorrect model parameters.
- New tests assert correct behavior for both tuple and single value results from content safety checks.
- Additional tests ensure that ValueErrors are raised when required model information is missing.
- Tests verify the logic of the content safety output mapping function.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1240 +/- ##
===========================================
+ Coverage 69.04% 69.34% +0.30%
===========================================
Files 161 161
Lines 15995 15995
===========================================
+ Hits 11043 11091 +48
+ Misses 4952 4904 -48
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
72d3e06
to
5249aa1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine. Should fix the copilot suggestion.
Also these tests are starting to involve a huge amount of duplicated code which should probably be refactored some. I'm less concerned because they're unit tests.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pouyan <13303554+Pouyanpi@users.noreply.github.com>
Description
Add tests for tuple unpacking implemented in #1207
Tests failing on develop branch prior to #1207:
https://github.com/NVIDIA/NeMo-Guardrails/actions/runs/15896264513/job/44828445306?pr=1240
Test pass after merging #1207:
https://github.com/NVIDIA/NeMo-Guardrails/actions/runs/15896746636?pr=1240