-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Java: Tests for Automodel Extraction Queries #13788
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
c78c031
to
bee43b0
Compare
After merging #13747, this needed minor updates 👍 |
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.
Glad to see tests! Some high level comments on structure before I get into checking the test cases themselves.
java/ql/test/query-tests/Telemetry/AutomodelApplicationModeExtractCandidates/Test.java
Outdated
Show resolved
Hide resolved
.../test/query-tests/Telemetry/AutomodelFrameworkModeExtractCandidates/java/nio/file/Files.java
Outdated
Show resolved
Hide resolved
following @adityasharad's comments, this has been restructured significantly. Before merging this, I'd like to squash these commits a bit. |
64d38ef
to
9c51f4d
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.
Good stuff. A few minor comments.
...emetry/AutomodelApplicationModeExtraction/AutomodelApplicationModeExtractCandidates.expected
Show resolved
Hide resolved
...-tests/Telemetry/AutomodelFrameworkModeExtraction/com/github/codeql/test/NonPublicClass.java
Show resolved
Hide resolved
...ery-tests/Telemetry/AutomodelFrameworkModeExtraction/com/github/codeql/test/PublicClass.java
Show resolved
Hide resolved
In PR #13823, we had rewritten the endpoints that are being considered for framework mode. We used to use `DataFlow::ParameterNode` as endpoints. However, `ParameterNode`s do not exist for the implicit `this` parameter; they also do not exist for bodiless interface-methods. In PR #13823, we forgot to model that `this` only exists for non-static methods and to only consider parameters that we have source code for.
…rface-method parameter extraction
b73d869
to
621c05d
Compare
@adityasharad, do you think this can be merged? If so, do you think I should squash these commits a bit, or would you merge as-is? |
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.
Looks good. I also verified that the new tests did actually run in the Java Language Tests run. Commits are clear enough I think, no need to squash.
This PR adds some tests for the automodel extraction queries.
@adityasharad
will review this, but other reviewers are always welcome.java.io.File
implemented in the test suite. I find this much easier than the suggested implementation. I was hoping this would work, and I'm glad it does.How to review/Questions for the reviewers:
The reason why this only tests some of our queries (only the extraction queries; the queries share most of the implementations behind the scenes) is to manage the maintenance overhead of the test suites. LMK if you disagree with that and would like to see more test suites.