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

Update SQL obfuscation tests to include cases for Active Record Query Logs #2420

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

kaylareopelle
Copy link
Contributor

Overview

SQL Obfuscation work in open-telemetry/opentelemetry-ruby-contrib#529 revealed we may have a gap in testing for queries prepended by comments in the style of Marginalia (pre-Rails 7) and Active Record Query Logs (Rails 7+).

This PR adds tests for those cases. If we choose to merge this PR, we'll need to follow-up with an update to the cross-agent tests, since these fixtures are synced with that repository. If we don't want to go that route, I'll move these tests so they're separate from the cross-agent tests.

This type of test may have cross-agent value because Google's sqlcommenter tool supports many different languages and databases and uses a similar syntax.

The prepended comments used in these tests are drawn from Active
Record Query Logs/Marginalia-style comments. This is also known
as sqlcommenter in other languages.
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 93.74% 93%
Branch 71.82% 71%

@kaylareopelle kaylareopelle changed the title WIP: Update SQL obfuscation tests to include cases for Active Record Query Logs Update SQL obfuscation tests to include cases for Active Record Query Logs Jan 30, 2024
@kaylareopelle kaylareopelle marked this pull request as ready for review January 30, 2024 23:03
@kaylareopelle
Copy link
Contributor Author

I'm going to go ahead and merge this. PR to add this to our cross agent tests (internal) to avoid these new cases from being accidentally overwritten.

@kaylareopelle kaylareopelle reopened this Feb 2, 2024
@kaylareopelle kaylareopelle merged commit 3ebd85a into dev Feb 2, 2024
31 checks passed
@kaylareopelle kaylareopelle deleted the sql-testing branch February 2, 2024 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants