-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Java: add integration test for query suite contents #19229
Conversation
5bd0c39
to
d17d441
Compare
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.
Pull Request Overview
This PR introduces an integration test to verify the query suite contents for Java.
- Adds a new integration test file that iterates over defined query suites and compares expected query files with actual output.
Files not reviewed (4)
- java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected: Language not supported
- java/ql/integration-tests/java/query-suite/java-code-scanning.qls.expected: Language not supported
- java/ql/integration-tests/java/query-suite/java-security-and-quality.qls.expected: Language not supported
- java/ql/integration-tests/java/query-suite/java-security-extended.qls.expected: Language not supported
Comments suppressed due to low confidence (1)
java/ql/integration-tests/java/query-suite/test.py:11
- Consider validating that each line in the actual query output is at least as long as the semmle_code_dir prefix to avoid slicing errors.
index = len(str(semmle_code_dir))
Tip: Leave feedback on Copilot's review comments with the 👎 and 👍 buttons to help improve review quality. Learn more
|
||
for query_suite in query_suites: | ||
actual = codeql.resolve.queries(query_suite, _capture=True).strip() | ||
actual = sorted(actual.split('\n')) |
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.
here is not required as we're running this on Linux, but just so you know, actual.splitlines()
will work across platforms (accounting for Windows \n\r
line separation)
Co-authored-by: Paolo Tranquilli <redsun82@github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0f5c53b
to
ffcf6d6
Compare
import pytest | ||
|
||
@runs_on.linux | ||
@pytest.mark.parametrize("query_suite", ['java-code-quality.qls', 'java-security-and-quality.qls', 'java-security-extended.qls', 'java-code-scanning.qls']) |
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.
Nitpick: consider making these in alphabetical order.
This PR adds an integration test that explicitly checks which Java queries are included in which query suite.