[Spotless] Applying Google Code Format for integ-tests #8#327
[Spotless] Applying Google Code Format for integ-tests #8#327MitchellGale merged 1 commit intointeg/sl_GoogleJavaFormat8from
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.
Is is possible to ask spotless to keep some string literals unmodified aka exception? Please, check.
There was a problem hiding this comment.
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.
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)
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
| JSONObject result = | ||
| executeQuery( | ||
| String.format( | ||
| "SELECT gender " + "FROM %s " + "GROUP BY gender " + "HAVING COUNT(*) > 0", |
There was a problem hiding this comment.
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.
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.
Same as above, this can be combined into a single quote
There was a problem hiding this comment.
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.
Should this have been uncommented out?
There was a problem hiding this comment.
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"; |
| "| 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"; |
4baa02d to
0521d7c
Compare
Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> add ignore failures for build.gradle. Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> Reverting ignore for checkstyle in integ-test Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> Addressed PR comments. Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> Addressed PR comments to expand jav doc. Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> fixed string formatting Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> Fixed string formatting. Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> Fixed string formatting in MatchPhrasePrefixIT Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
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 <Mitchell.Gale@improving.com> * Apply suggestions from code review Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> Signed-off-by: Mitchell Gale <Mitchell.gale@improving.com> * address PR comments Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> --------- Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> Signed-off-by: Mitchell Gale <Mitchell.gale@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
…-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 <Mitchell.Gale@improving.com> * Apply suggestions from code review Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com> Signed-off-by: Mitchell Gale <Mitchell.gale@improving.com> * address PR comments Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> --------- Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com> Signed-off-by: Mitchell Gale <Mitchell.gale@improving.com> Co-authored-by: Yury-Fridlyand <yury.fridlyand@improving.com>
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.