-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Test: Support arbitrary locations in inline test post-processor #18735
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.
PR Overview
This PR extends the inline test post-processor's support to allow queries that select locations not bound to an instance of Location, and it ensures that custom location ranges via hasLocationInfo are handled correctly. In addition, one JS query—previously blocking the migration to post-processed inline expectations—has been ported as part of the tests.
- Extended support for arbitrary locations in inline test post-processing.
- Ported an existing JS query to exercise the new functionality.
- Updated inline test expectations to include alert markers for duplicate dependency alerts.
Changes
| File | Description |
|---|---|
| javascript/ql/test/query-tests/AngularJS/DuplicateDependency/duplicates.js | Updated inline test expectations and alert markers to validate the new support for arbitrary location queries. |
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
javascript/ql/test/query-tests/AngularJS/DuplicateDependency/duplicates.js:15
- The inline alert marker for this multi-line function may be ambiguous regarding which part of the function it refers to. Consider repositioning or clarifying the alert marker to ensure that the intended location is unambiguous.
.run(['dup11a', 'dup11a', function(dup11a, dup11b){ // $ Alert - alert formatting for multi-line function
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
hvitved
left a comment
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.
LGTM, some minor suggestions.
Co-authored-by: Tom Hvitved <hvitved@github.com>
Makes the inline test post-processor support queries that select a location that does not correspond to an instance of
Location. This can happen when it selects an entity that useshasLocationInfoto craft a custom location range.To ensure the behavior is exercised, this PR also ports one of the JS queries for which this was blocking migration to post-processed inline expectations.