Conversation
asger-semmle
previously approved these changes
Feb 27, 2019
asger-semmle
left a comment
Contributor
There was a problem hiding this comment.
This is seriously awesome!
I obviously haven't checked that the rewrite was correct, but the naming convention and resulting .ql LGTM.
Author
|
https://jira.semmle.com/browse/ODASA-7810. |
Contributor
|
Could you rebase now that the failing test on master has been fixed? |
This speeds up the tests for express since the tests now are compiled together: the total test time for the affected directory was 1102 seconds before this change, and 48.7 seconds after: a 95% time reduction. Besides the speedup, a major difference between the two test styles is that all selected entities now must have an explicit type, this is a bit more verbose, but also produce a slightly better tests. I have picked a naming convention for the query predicates: they all start with "test_" to allow for writing capitalized class names. I expect similar improvements for other large test directories to trickle in later. - Process for doing this rewrite: `cat *.ql >> Test.ql`, and then rewrite manually from the top. This is slightly suboptimal: I can not be sure the rewritten tests are equivalent. :( A better process would have been to rewrite each test in isolation, and then concatenate them into one big file afterwards.
|
(Please don't merge just yet, I'm trying out an alternative approach I'd like to show for comparison.) |
|
Superseded by #1018. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This speeds up the tests for Express since the tests now are compiled
together: the total test time for the affected directory was 1102 seconds
before this change, and 48.7 seconds after: a 95% time reduction.
Besides the speedup, a major difference between the two test styles is
that all selected entities now must have an explicit type, this is a
bit more verbose, but also produce slightly better tests.
I have picked a naming convention for the query predicates: they all
start with "test_" to allow for writing capitalized class names.
I expect similar improvements for other large test directories to
trickle in later.
Process for doing this rewrite:
cat *.ql >> Test.ql, and thenrewrite manually from the top. This is slightly suboptimal: I can not
be entirely sure the rewritten tests are equivalent. :(
A better process would have been to rewrite each test in isolation,
and then concatenate them into one big file afterwards.