8000 test(content_safety): add tests for content safety actions by Pouyanpi · Pull Request #1240 · NVIDIA/NeMo-Guardrails · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 4 commits into from
Jun 26, 2025

Conversation

Pouyanpi
Copy link
Collaborator
@Pouyanpi Pouyanpi commented Jun 26, 2025

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

@Pouyanpi Pouyanpi added this to the v0.14.1 milestone Jun 26, 2025
@Pouyanpi Pouyanpi self-assigned this Jun 26, 2025
@Pouyanpi Pouyanpi requested a review from Copilot June 26, 2025 08:05
Copy link
@Copilot Copilot AI left a 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-commenter
Copy link
codecov-commenter commented Jun 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.34%. Comparing base (8d27470) to head (b6f77bf).
Report is 2 commits behind head on develop.

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     
Flag Coverage Δ
python 69.34% <ø> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Pouyanpi Pouyanpi requested a review from cparisien June 26, 2025 08:09
@Pouyanpi Pouyanpi force-pushed the test/tuple-unpacking-content-safety branch from 72d3e06 to 5249aa1 Compare June 26, 2025 08:21
Copy link
Collaborator
@cparisien cparisien left a 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.

8000

Pouyanpi and others added 2 commits June 26, 2025 15:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Pouyan <13303554+Pouyanpi@users.noreply.github.com>
@Pouyanpi Pouyanpi merged commit c9cfa7e into develop Jun 26, 2025
17 checks passed
@Pouyanpi Pouyanpi deleted the test/tuple-unpacking-content-safety branch June 26, 2025 13:52
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.

3 participants
0