-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Issue #15026: Added support to check input file against whole google configuration for google IT tests #15028
Conversation
@Test | ||
public void testAnnotation() throws Exception { | ||
final String[] listOfModules = { | ||
"AnnotationLocationMostCases", | ||
"InvalidJavadocPosition", | ||
}; | ||
|
||
final String filePath = getPath("InputClassAnnotations.java"); | ||
|
||
verifyWithGoogleConfigParser(listOfModules, filePath); | ||
verifyWithWholeGoogleConfig(filePath); | ||
} |
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.
Example of using the new method 🐪🐫
src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java
Outdated
Show resolved
Hide resolved
src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java
Outdated
Show resolved
Hide resolved
332df57
to
c3f84d0
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.
last minors:
src/it/java/com/google/checkstyle/test/base/AbstractGoogleModuleTestSupport.java
Outdated
Show resolved
Hide resolved
src/it/java/com/google/checkstyle/test/base/AbstractGoogleModuleTestSupport.java
Outdated
Show resolved
Hide resolved
...oogle/checkstyle/test/chapter4formatting/rule4852classannotations/InputClassAnnotations.java
Show resolved
Hide resolved
...oogle/checkstyle/test/chapter4formatting/rule4852classannotations/InputClassAnnotations.java
Show resolved
Hide resolved
c3f84d0
to
aff00e1
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.
ok to merge.
@rnveach , please share your concerns and think if we can improve in separate PR on them.
This PR is "blocking" migration to whole configs, that will be significant effort, but it will NOT touch Abstract classes, so we can do fixes in parallel.
src/it/java/com/google/checkstyle/test/base/AbstractGoogleModuleTestSupport.java
Outdated
Show resolved
Hide resolved
src/it/java/com/google/checkstyle/test/base/AbstractGoogleModuleTestSupport.java
Show resolved
Hide resolved
src/it/java/com/google/checkstyle/test/base/AbstractGoogleModuleTestSupport.java
Outdated
Show resolved
Hide resolved
googleConfig.addChild(treeWalkerConfig); | ||
} | ||
|
||
verifyWithItConfig(googleConfig, filePath); |
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.
Same as other verifyWithItConfig
comment.
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.
This is also dropped for the same reason, but also this whole method should be removed eventually when we switch everything to the whole config.
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.
@Zopsss Where is issue to eventually go back to convert other tests? This should be added to the end there and a comment until http://....
should be added to this method.
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.
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.
added until
message
checkstyle/src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java
Lines 459 to 467 in fb67e1c
// until https://github.com/checkstyle/checkstyle/issues/14937 | |
/** | |
* Performs the verification of the file with the given file path and config. | |
* | |
* @param config config to check against. | |
* @param filePath input file path. | |
* @throws Exception if exception occurs during verification process. | |
*/ | |
protected void verifyWithItConfig(Configuration config, String filePath) throws Exception { |
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.
@Zopsss until
was placed in wrong location. until
is basically reminding us the mentioned method is to be removed. verifyWithItConfig
is the way we will be proceeding now (unless something comes up), so this method should stay.
The note should be on verifyWithConfigParser
in AbstractGoogle
. We are only keeping it until all tests move over to full config testing. Once we do, it can be removed completely.
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.
done
1b71a04
to
fb67e1c
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.
items:
fb67e1c
to
2d4f429
Compare
Blocked from merging by #15072 , but code updates and reviews can still be done. |
2d4f429
to
fd20d22
Compare
8a46eaf
to
86a2044
Compare
86a2044
to
6550734
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.
lgtm
src/it/java/com/google/checkstyle/test/base/AbstractGoogleModuleTestSupport.java
Show resolved
Hide resolved
221e3d8
to
d789152
Compare
@Zopsss Please rebase. |
…le google configuration for google IT tests
d789152
to
ee369eb
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.
rebased in github
ok to merge
issue #15026
created a new method:
verifyWithWholeGoogleConfig()
which helps us to check the input file against whole google configuration. We just require to pass the file path to the method and everything else will work like a magic 🔮🪄