Visitar URL original
InlineExpectationsTest: Fail if missing `getARelevantTag` by RasmusWL · Pull Request #10999 · github/codeql · GitHub
The Wayback Machine - https://web.archive.org/web/20260508153547/https://github.com/github/codeql/pull/10999
Skip to content

InlineExpectationsTest: Fail if missing getARelevantTag#10999

Merged
RasmusWL merged 11 commits intogithub:mainfrom
RasmusWL:inline-fail-tag
Oct 28, 2022
Merged

InlineExpectationsTest: Fail if missing getARelevantTag#10999
RasmusWL merged 11 commits intogithub:mainfrom
RasmusWL:inline-fail-tag

Conversation

@RasmusWL
Copy link
Copy Markdown
Member

This PR changes InlineExpectationsTest so it explicitly fails if you provided an actual result with a tag that is not part of getARelevantTag.

To illustrate why this is useful, previously if you had the annotated code below

foo # $ foo=val

# with wrong value
foo # $ foo=bad-value

# there is a typo here, so this result is actually missing!
fooo # $ foo=val

and got the following in your .expected file, you might assume that the remainder of the expectations with foo tags were valid, which they are not!

| test.py:4:1:4:3 | foo | Unexpected result: foo=val |

smowton
smowton previously approved these changes Oct 26, 2022
@erik-krogh
Copy link
Copy Markdown
Contributor

erik-krogh commented Oct 26, 2022 •

A pushed a version bump in the qlpack.yml for QL-for-QL directly to this branch, that should get it to compile again.

@RasmusWL
Copy link
Copy Markdown
Member Author

Java (kotlin) tests might still fail until #11006 is merged

michaelnebel
michaelnebel previously approved these changes Oct 27, 2022
Copy link
Copy Markdown
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C# LGTM

erik-krogh
erik-krogh previously approved these changes Oct 27, 2022
@MathiasVP
Copy link
Copy Markdown
Contributor

MathiasVP commented Oct 27, 2022 •

I might be misunderstanding what the goal of this PR is, but doesn't this change go against the QLDoc on getARelevantTag:

/**
 * [...] Any expected result comments for a tag that is not returned by the `getARelevantTag()`
 * predicate for an active test will be ignored. This makes it possible to write multiple tests in
 * different `.ql` files that all query the same source code.
 */

?

Oh, wait. Now I understand! You're finding cases where there is an actual result which is not of an expected tag. This LGTM 👍

MathiasVP
MathiasVP previously approved these changes Oct 27, 2022
@RasmusWL RasmusWL dismissed stale reviews from MathiasVP, erik-krogh, and michaelnebel via cee9139 October 27, 2022 13:17
@RasmusWL
Copy link
Copy Markdown
Member Author

Java was failing CI. I fixed up the annotations for the JaxWs modeling, but the integrations test will probably keep on failing.

Comment thread java/ql/test/library-tests/frameworks/JaxWs/JakartaRs1.java Outdated
Comment thread java/ql/test/library-tests/frameworks/JaxWs/JakartaRs1.java Outdated
@RasmusWL
Copy link
Copy Markdown
Member Author

This seems to be an invalid sink due to the text/plain content type

Seems reasonable to me. Have removed the annotations from both files.

@RasmusWL RasmusWL requested a review from atorralba October 27, 2022 13:57
Copy link
Copy Markdown
Contributor

@atorralba atorralba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Java 👍

@RasmusWL
Copy link
Copy Markdown
Member Author

#11025 should fix the Java integration tests, I will merge this PR regardless, since it doesn't touch these!

@RasmusWL RasmusWL merged commit 8628ff5 into github:main Oct 28, 2022
@RasmusWL RasmusWL deleted the inline-fail-tag branch October 28, 2022 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants