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

Consolidate all InlineFlowTest libraries in the dataflow qlpack #14050

Merged
merged 2 commits into from Aug 29, 2023

Conversation

jketema
Copy link
Contributor

@jketema jketema commented Aug 24, 2023

No description provided.

@jketema jketema changed the title Share InlineFlowTest Consolidate all InlineFlowTest libraries in the dataflow qlpack Aug 24, 2023
@jketema jketema marked this pull request as ready for review August 25, 2023 06:16
@jketema jketema requested review from a team as code owners August 25, 2023 06:16
@jketema jketema requested a review from hvitved August 25, 2023 06:16
Copy link
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 changes LGTM. Thanks for doing this, it feels good to witness tests and test libraries getting increasingly cleaner :)

Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for doing this. A few minor questions.

predicate isSink(DataFlowLang::Node sink) { none() }
}

module FlowTest<DataFlow::ConfigSig ValueFlowConfig, DataFlow::ConfigSig TaintFlowConfig> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be private?

Copy link
Contributor Author

@jketema jketema Aug 29, 2023

Choose a reason for hiding this comment

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

No, there are tests that override both configurations. For example:

import FlowTest<DefaultFlowConfig, SinatraConfig>

and:

import FlowTest<CustomConfig, CustomConfig>

@@ -1,4 +1,5 @@
import go
import TestUtilities.InlineExpectationsTest
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this import needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was originally exposed through InlineFlowTest, which it is no longer. It's needed later in this file, because it also defines an inline expectation test next to an inline flow test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd happily expose this again through InlineFlowTest (and the same below), but this seems somewhat cleaner.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this is certainly better.

@@ -1,4 +1,5 @@
import java
import semmle.code.java.dataflow.ExternalFlow
Copy link
Contributor

Choose a reason for hiding this comment

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

same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was originally exposed through InlineFlowTest, which it is no longer. It's needed later in this file for ModelValidation.

@jketema jketema merged commit 0d1fd88 into github:main Aug 29, 2023
34 checks passed
@jketema jketema deleted the inline-6 branch August 29, 2023 07:30
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.

None yet

3 participants