system-tests
                                
                                
                                
                                    system-tests copied to clipboard
                            
                            
                            
                        Excluding PII identifiers should work for DI tracers
Motivation
This pull request enhances the PII redaction tests by introducing support for excluded identifiers. The changes ensure that specific identifiers, such as cookie and sessionid, are excluded from redaction and are validated accordingly. The most important updates include modifications to the test logic, the addition of new test scenarios, and updates to the configuration for excluded identifiers.
Changes
- Support for excluded identifiers in tests:
- Introduced the 
EXCLUDED_IDENTIFIERSlist intests/debugger/test_debugger_pii.pyto specify identifiers that should not be redacted, such ascookieandsessionid. - Updated the 
_assertand_validate_pii_keyword_redactionmethods to handle excluded identifiers, ensuring they are present in snapshots and not improperly redacted. [1] [2] [3] 
 - Introduced the 
 - New test scenarios for excluded identifiers:
- Added a new test case, 
test_pii_redaction_excluded_identifiers, to validate the behavior of excluded identifiers. This includes handling missing features and known bugs across different libraries. 
 - Added a new test case, 
 - Environment variable for excluded identifiers:
- Added 
DD_DYNAMIC_INSTRUMENTATION_REDACTION_EXCLUDED_IDENTIFIERSto theDEBUGGER_PII_REDACTIONscenario specifyingcookie,_2fa, andsessionid. 
 - Added 
 
Workflow
- ⚠️ Create your PR as draft ⚠️
 - Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
 - Mark it as ready for review
- Test logic is modified? -> Get a review from RFC owner. We're working on refining the 
codeownersfile quickly. - Framework is modified, or non obvious usage of it -> get a review from R&P team
 
 - Test logic is modified? -> Get a review from RFC owner. We're working on refining the 
 
:rocket: Once your PR is reviewed, you can merge it!
Reviewer checklist
- [ ] If PR title starts with 
[<language>], double-check that only<language>is impacted by the change - [ ] No system-tests internal is modified. Otherwise, I have the approval from R&P team
 - [ ] CI is green, or failing jobs are not related to this change (and you are 100% sure about this statement)
 - [ ] A docker base image is modified?
- [ ] the relevant 
build-XXX-imagelabel is present 
 - [ ] the relevant 
 - [ ] A scenario is added (or removed)?
- [ ] Get a review from R&P team