Skip to content

Commit 8c73e8c

Browse files
authored
Ignore new Locales used in tests ES SQL (elastic#138360) (elastic#138556)
These locales are probably "new" and should have been added to the list of ignored ones for that specific test file. The main reason is that ES SQL is Locale-insensitive, while H2 (the database we compare the results with) is Locale sensitive. Fixes elastic#112640 Fixes elastic#112641 Fixes elastic#112642 Fixes elastic#112643 Fixes elastic#112746 (cherry picked from commit f569ef3)
1 parent af2aebd commit 8c73e8c

File tree

3 files changed

+17
-25
lines changed

3 files changed

+17
-25
lines changed

muted-tests.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,6 @@ tests:
6363
- class: org.elasticsearch.packaging.test.PackagesSecurityAutoConfigurationTests
6464
method: test20SecurityNotAutoConfiguredOnReInstallation
6565
issue: https://github.com/elastic/elasticsearch/issues/112635
66-
- class: org.elasticsearch.xpack.sql.qa.single_node.JdbcSqlSpecIT
67-
method: test {case-functions.testSelectInsertWithLcaseAndLengthWithOrderBy}
68-
issue: https://github.com/elastic/elasticsearch/issues/112642
69-
- class: org.elasticsearch.xpack.sql.qa.single_node.JdbcSqlSpecIT
70-
method: test {case-functions.testUcaseInline1}
71-
issue: https://github.com/elastic/elasticsearch/issues/112641
72-
- class: org.elasticsearch.xpack.sql.qa.single_node.JdbcSqlSpecIT
73-
method: test {case-functions.testUpperCasingTheSecondLetterFromTheRightFromFirstName}
74-
issue: https://github.com/elastic/elasticsearch/issues/112640
75-
- class: org.elasticsearch.xpack.sql.qa.single_node.JdbcSqlSpecIT
76-
method: test {case-functions.testUcaseInline3}
77-
issue: https://github.com/elastic/elasticsearch/issues/112643
7866
- class: org.elasticsearch.xpack.ml.integration.MlJobIT
7967
method: testDelete_multipleRequest
8068
issue: https://github.com/elastic/elasticsearch/issues/112701
@@ -90,18 +78,6 @@ tests:
9078
- class: org.elasticsearch.xpack.ml.integration.MlJobIT
9179
method: testCreateJob_WithClashingFieldMappingsFails
9280
issue: https://github.com/elastic/elasticsearch/issues/113046
93-
- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT
94-
method: test {case-functions.testUcaseInline1}
95-
issue: https://github.com/elastic/elasticsearch/issues/112641
96-
- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT
97-
method: test {case-functions.testUcaseInline3}
98-
issue: https://github.com/elastic/elasticsearch/issues/112643
99-
- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT
100-
method: test {case-functions.testUpperCasingTheSecondLetterFromTheRightFromFirstName}
101-
issue: https://github.com/elastic/elasticsearch/issues/112640
102-
- class: org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT
103-
method: test {case-functions.testSelectInsertWithLcaseAndLengthWithOrderBy}
104-
issue: https://github.com/elastic/elasticsearch/issues/112642
10581
- class: org.elasticsearch.xpack.inference.rest.ServerSentEventsRestActionListenerTests
10682
method: testResponse
10783
issue: https://github.com/elastic/elasticsearch/issues/113148

x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc/SqlSpecTestCase.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,17 @@ protected int fetchSize() {
8686
protected final void doTest() throws Throwable {
8787
// we skip the tests in case of these locales because ES-SQL is Locale-insensitive for now
8888
// while H2 does take the Locale into consideration
89-
String[] h2IncompatibleLocales = new String[] { "tr", "az", "tr-TR", "tr-CY", "az-Latn", "az-Cyrl", "az-Latn-AZ", "az-Cyrl-AZ" };
89+
String[] h2IncompatibleLocales = new String[] {
90+
"tr",
91+
"az",
92+
"tr-TR",
93+
"tr-CY",
94+
"az-Latn",
95+
"az-Cyrl",
96+
"az-Latn-AZ",
97+
"az-Cyrl-AZ",
98+
"tr-Latn-TR",
99+
"az-AZ" };
90100
boolean goodLocale = Arrays.stream(h2IncompatibleLocales)
91101
.anyMatch((l) -> Locale.getDefault().equals(new Locale.Builder().setLanguageTag(l).build())) == false;
92102
if (fileName.startsWith("case-functions")) {

x-pack/plugin/sql/qa/server/src/main/resources/case-functions.sql-spec

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
// To mute tests follow example in file: example.sql-spec
22

3+
// For anyone reaching this file in the future coming from CI failures related to uppercasing/lowercasing tests:
4+
// For example: Different result for column [upper], entry [1] expected:< ELAST[İ]C > but was:< ELAST[I]C >
5+
// Go to SqlSpecTestCase.doTest() method and look for h2IncompatibleLocales and add the faulty Locale there,
6+
// after you double check that the issue is indeed related to that specific Locale.
7+
38
// Next 4 SELECTs in this file are related to https://github.com/elastic/elasticsearch/issues/32589
49
// H2 is Locale sensitive, while ES-SQL is not (so far)
10+
511
selectInsertWithLcaseAndLengthWithOrderBy
612
SELECT "first_name" origFN, "last_name" origLN, INSERT(UCASE("first_name"),LENGTH("first_name")+1,123,LCASE("last_name")) modified FROM "test_emp" WHERE ASCII("first_name")=65 ORDER BY "first_name" ASC, "last_name" ASC LIMIT 10;
713

0 commit comments

Comments
 (0)