Skip to content
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

Add E2E test for bias detection of guardrails #708

Merged
merged 3 commits into from
Sep 19, 2024
Merged

Add E2E test for bias detection of guardrails #708

merged 3 commits into from
Sep 19, 2024

Conversation

qgao007
Copy link
Collaborator

@qgao007 qgao007 commented Sep 18, 2024

Description

Add E2E test for bias detection

Issues

To meet E2E test requirement raised by Suyue

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • [ X] New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)
  • Others (enhancement, documentation, validation, etc.)

Dependencies

No.

Tests

ran the E2E test and validated the result to be correct.

Validate microservice started
+ echo 'test 1 - biased'
__test 1 - biased__
++ curl localhost:9092/v1/bias -X POST -d '{"text":"**John McCain exposed as an unprincipled politician.**"}' -H 'Content-Type: application/json'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   192  100   131  100    61     31     14  0:00:04  0:00:04 --:--:--    45
+ result='{"downstream_black_list":[".*"],"id":"5b500c5a26b3a86c4d6285961b8788df","text":"Violated policies: bias, please check your input."}'
+ [[ {"downstream_black_list":[".*"],"id":"5b500c5a26b3a86c4d6285961b8788df","text":"Violated policies: bias, please check your input."} == *\V\i\o\l\a\t\e\d* ]]
+ echo 'Result correct.'
**Result correct.**
+ echo 'test 2 - non-biased'
test 2 - non-biased
++ curl localhost:9092/v1/bias -X POST -d '{"text":"**John McCain described as an unprincipled politician."**}' -H 'Content-Type: application/json'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   193  100   130  100    63  11818   5727 --:--:-- --:--:-- --:--:-- 17545
+ result='{"downstream_black_list":[],"id":"3cf2a36b5f424dfdb9223d49aca62037","text":"John McCain described as an unprincipled politician."}'
+ [[ {"downstream_black_list":[],"id":"3cf2a36b5f424dfdb9223d49aca62037","text":"John McCain described as an unprincipled politician."} == *\d\e\s\c\r\i\b\e\d* ]]
+ echo 'Result correct.'
**Result correct.**
**+ echo 'Validate microservice completed'**

@qgao007
Copy link
Collaborator Author

qgao007 commented Sep 18, 2024

@chensuyue Added and validated E2E test for bias detection.

Copy link
Collaborator

@ashahba ashahba left a comment

Choose a reason for hiding this comment

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

LGTM!

lkk12014402 pushed a commit that referenced this pull request Sep 19, 2024
* Update readme for manifests of some examples

Signed-off-by: lvliang-intel <[email protected]>
@lvliang-intel lvliang-intel merged commit e29865e into main Sep 19, 2024
10 checks passed
@lvliang-intel lvliang-intel deleted the qg/bias branch September 19, 2024 01:22
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