-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Spotless] Applying Google Code Format for integ-tests #8 #327
[Spotless] Applying Google Code Format for integ-tests #8 #327
Conversation
Codecov Report
@@ Coverage Diff @@
## integ/sl_GoogleJavaFormat8 #327 +/- ##
=============================================================
Coverage 97.51% 97.51%
Complexity 4657 4657
=============================================================
Files 408 408
Lines 11933 11933
Branches 829 829
=============================================================
Hits 11637 11637
Misses 289 289
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
integ-test/src/test/java/org/opensearch/sql/legacy/AggregationIT.java
Outdated
Show resolved
Hide resolved
"{ \"fetch_size\": 200, \"query\": \" SELECT age, state FROM %s WHERE age > ? OR" | ||
+ " state IN (?, ?)\", \"parameters\": [ { \"type\": \"integer\", " | ||
+ " \"value\": 25 }, { \"type\": \"string\", \"value\":" | ||
+ " \"WA\" }, { \"type\": \"string\", \"value\": \"UT\"" | ||
+ " } ]}", |
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.
Is is possible to ask spotless to keep some string literals unmodified aka exception? Please, check.
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.
To my best research, it is not possible to have an exception for that in spotless. Spotless seems to be a very strict application of the Google Java Format.
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.
I see SL keeps format for other tests. See newSettingNewEndpoint
on this PR or https://github.com/Bit-Quill/opensearch-project-sql/pull/328/files#diff-2f3432d682c1cca41cfda328adbdf15149e610abb1dc522082218c1d6126669fR98-R111 (integ-test/src/test/java/org/opensearch/sql/legacy/PluginIT.java)
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.
Fixed.
integ-test/src/test/java/org/opensearch/sql/legacy/MetaDataQueriesIT.java
Outdated
Show resolved
Hide resolved
integ-test/src/test/java/org/opensearch/sql/sql/DateTimeImplementationIT.java
Outdated
Show resolved
Hide resolved
integ-test/src/test/java/org/opensearch/sql/sql/LikeQueryIT.java
Outdated
Show resolved
Hide resolved
JSONObject result = | ||
executeQuery( | ||
String.format( | ||
"SELECT gender " + "FROM %s " + "GROUP BY gender " + "HAVING COUNT(*) > 0", |
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.
Since this has been moved to be on the same row rather than split onto multiple rows I believe that we can have this whole row be in one set of quotations rather than split into multiple with + signs between them
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 catch, thanks, fixed.
JSONObject result = | ||
executeQuery( | ||
String.format( | ||
"SELECT a.gender " + "FROM %s a " + "GROUP BY a.gender " + "HAVING COUNT(*) > 0", |
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 above, this can be combined into a single quote
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 catch, thanks, fixed.
/** | ||
* <a> | ||
* http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-daterange-aggregation.html</a> | ||
*/ | ||
@Test | ||
@Ignore | ||
public void countDateRangeTest() throws IOException { | ||
String result = | ||
explainQuery( | ||
String.format( | ||
"select online from %s group by date_range(" | ||
+ "field='insert_time', 'format'='yyyy-MM-dd' ,'2014-08-18','2014-08-17', " | ||
+ "'now-8d','now-7d','now-6d','now')", | ||
TEST_INDEX_ONLINE)); | ||
// TODO: fix the query or fix the code for the query to work | ||
} |
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.
Should this have been uncommented out?
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.
Was requested here: #327 (comment). The @ignore was added to not run the test.
"| where match_phrase_prefix(Tags, 'gas ta', slop=2) " + | ||
"| fields Tags"; | ||
String query = | ||
"source = %s" + "| where match_phrase_prefix(Tags, 'gas ta', slop=2) " + "| fields Tags"; |
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.
unneeded split up quotations
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.
thanks, fixed.
"| where match_phrase_prefix(Tags, 'gas ta', slop=3)" + | ||
"| fields Tags"; | ||
String query = | ||
"source = %s" + "| where match_phrase_prefix(Tags, 'gas ta', slop=3)" + "| fields Tags"; |
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.
split quotations
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.
thanks, fixed.
4baa02d
to
0521d7c
Compare
Signed-off-by: Mitchell Gale <[email protected]> add ignore failures for build.gradle. Signed-off-by: Mitchell Gale <[email protected]> Reverting ignore for checkstyle in integ-test Signed-off-by: Mitchell Gale <[email protected]> Addressed PR comments. Signed-off-by: Mitchell Gale <[email protected]> Addressed PR comments to expand jav doc. Signed-off-by: Mitchell Gale <[email protected]> fixed string formatting Signed-off-by: Mitchell Gale <[email protected]> Fixed string formatting. Signed-off-by: Mitchell Gale <[email protected]> Fixed string formatting in MatchPhrasePrefixIT Signed-off-by: Mitchell Gale <[email protected]>
0521d7c
to
3e16d96
Compare
…-project#1962) * spotless apply for 81 integ-test files (#327) add ignore failures for build.gradle. Reverting ignore for checkstyle in integ-test Addressed PR comments. Addressed PR comments to expand jav doc. fixed string formatting Fixed string formatting. Fixed string formatting in MatchPhrasePrefixIT Signed-off-by: Mitchell Gale <[email protected]> * Apply suggestions from code review Co-authored-by: Yury-Fridlyand <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> * address PR comments Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> Co-authored-by: Yury-Fridlyand <[email protected]>
…-project#1962) * spotless apply for 81 integ-test files (#327) add ignore failures for build.gradle. Reverting ignore for checkstyle in integ-test Addressed PR comments. Addressed PR comments to expand jav doc. fixed string formatting Fixed string formatting. Fixed string formatting in MatchPhrasePrefixIT Signed-off-by: Mitchell Gale <[email protected]> * Apply suggestions from code review Co-authored-by: Yury-Fridlyand <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> * address PR comments Signed-off-by: Mitchell Gale <[email protected]> --------- Signed-off-by: Mitchell Gale <[email protected]> Signed-off-by: Mitchell Gale <[email protected]> Co-authored-by: Yury-Fridlyand <[email protected]>
Description
Spotless apply on integ-test (part 1 of 4 integ-test integration).
Issues Resolved
opensearch-project#1101
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.