-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
SQL: skip uppercasing/lowercasing function tests for AZ locales as well #32910
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1bfeec2
Added the rest of the Locales that have different behavior for upperc…
astefan d75b274
Merge remote-tracking branch 'remotes/origin/master' into 32589_fix_a…
astefan e0a8e06
Restored the initial Locale in tests
astefan d1f886d
Correct character encoding for utf8
astefan c29b990
Merge remote-tracking branch 'remotes/origin/master' into 32589_fix_a…
astefan 03c4343
Wrapped the Locale changing tests in try {} finally {} block
astefan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
import java.sql.Connection; | ||
import java.sql.ResultSet; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Locale; | ||
|
||
|
@@ -37,8 +38,7 @@ public static List<Object[]> readScriptSpec() throws Exception { | |
tests.addAll(readScriptSpec("/agg.sql-spec", parser)); | ||
tests.addAll(readScriptSpec("/arithmetic.sql-spec", parser)); | ||
tests.addAll(readScriptSpec("/string-functions.sql-spec", parser)); | ||
// AwaitsFix: https://github.com/elastic/elasticsearch/issues/32589 | ||
// tests.addAll(readScriptSpec("/case-functions.sql-spec", parser)); | ||
tests.addAll(readScriptSpec("/case-functions.sql-spec", parser)); | ||
return tests; | ||
} | ||
|
||
|
@@ -60,8 +60,9 @@ public SqlSpecTestCase(String fileName, String groupName, String testName, Integ | |
|
||
@Override | ||
protected final void doTest() throws Throwable { | ||
boolean goodLocale = !(Locale.getDefault().equals(new Locale.Builder().setLanguageTag("tr").build()) | ||
|| Locale.getDefault().equals(new Locale.Builder().setLanguageTag("tr-TR").build())); | ||
String[] badLocales = new String[] {"tr", "az", "tr-TR", "tr-CY", "az-Latn", "az-Cyrl", "az-Latn-AZ", "az-Cyrl-AZ"}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These locales are not bad :) it's just some application are buggy and cannot work with them correctly. So, maybe we should call them |
||
boolean goodLocale = !Arrays.stream(badLocales) | ||
.anyMatch((l) -> Locale.getDefault().equals(new Locale.Builder().setLanguageTag(l).build())); | ||
if (fileName.startsWith("case-functions")) { | ||
Assume.assumeTrue(goodLocale); | ||
} | ||
|
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.
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 think it might makes sense to restore the original locale after the test so other tests in this class don't run in this local most of the time.
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 deal here with restoring in a finally