SQL: Add examples fo muting sql/csv integ tests (#47291)

Add examples of failures for both sql and csv integeration
tests and instructions on how to mute them.

(cherry picked from commit 591bba46516d770f5fc95a4c536dd7448b74dd49)
This commit is contained in:
Marios Trivyzas 2019-10-01 09:11:34 +03:00
parent 170b102ab5
commit fa0b1b641a
No known key found for this signature in database
GPG Key ID: 8817B46B0CF36A3F
41 changed files with 168 additions and 9 deletions

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// Custom sorting/ordering on aggregates // Custom sorting/ordering on aggregates
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Aggs not supported by H2 / traditional SQL stores // Aggs not supported by H2 / traditional SQL stores
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// Group-By // Group-By
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
tableAlias tableAlias
SELECT emp_no, first_name FROM test_alias ORDER BY emp_no LIMIT 6; SELECT emp_no, first_name FROM test_alias ORDER BY emp_no LIMIT 6;

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Arithmetic tests outside H2 // Arithmetic tests outside H2
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// Arithmetic tests // Arithmetic tests
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// Next 4 SELECTs in this file are related to https://github.com/elastic/elasticsearch/issues/32589 // Next 4 SELECTs in this file are related to https://github.com/elastic/elasticsearch/issues/32589
// H2 is Locale sensitive, while ES-SQL is not (so far) // H2 is Locale sensitive, while ES-SQL is not (so far)
selectInsertWithLcaseAndLengthWithOrderBy selectInsertWithLcaseAndLengthWithOrderBy

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Test of explicit column types // Test of explicit column types
// the columns can be specified as <ColumnName:ColumnType> or as <ColumnName> // the columns can be specified as <ColumnName:ColumnType> or as <ColumnName>

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Commands // Commands
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
caseField caseField
SELECT emp_no, CASE WHEN emp_no - 10000 < 10 THEN 'First 10' ELSE 'Second 10' END as "case" FROM test_emp WHERE emp_no >= 10005 SELECT emp_no, CASE WHEN emp_no - 10000 < 10 THEN 'First 10' ELSE 'Second 10' END as "case" FROM test_emp WHERE emp_no >= 10005
ORDER BY emp_no LIMIT 10; ORDER BY emp_no LIMIT 10;

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Date // Date
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Unfortunately H2 doesn't support INTERVAL type, // Unfortunately H2 doesn't support INTERVAL type,
// hence why all INTERVAL tests need to be done manually // hence why all INTERVAL tests need to be done manually

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// DateTime // DateTime
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// DateTime // DateTime
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// CSV spec used by the docs // CSV spec used by the docs
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// CSV spec used by the geo docs // CSV spec used by the geo docs
// //

View File

@ -24,3 +24,52 @@ bar,3.5,4
tar,4.5,5 tar,4.5,5
; ;
// repeat the above // repeat the above
// Test failure example:
// org.elasticsearch.xpack.sql.qa.single_node.JdbcCsvSpecIT > test {pivot.testAverageWithOneValueAndLimit} FAILED
// java.lang.AssertionError: Elasticsearch [JdbcResultSet:row 4:cursor size 2:[languages<type=[BYTE]>, 'F'<type=[DOUBLE]>]] still has data after [3] entries:
// 3 | 53660.0
// at __randomizedtesting.SeedInfo.seed([81AF0740AC9F7D95:9FB389A0263106D]:0)
// at org.elasticsearch.xpack.sql.qa.single_node.JdbcCsvSpecIT.pivot.testAverageWithOneValueAndLimit(pivot.csv-spec:95)
// REPRODUCE WITH: ./gradlew ':x-pack:plugin:sql:qa:single-node:integTestRunner' --tests "org.elasticsearch.xpack.sql.qa.single_node.JdbcCsvSpecIT" -Dtests.method="test {pivot.testAverageWithOneValueAndLimit}" -Dtests.seed=81AF0740AC9F7D95 -Dtests.security.manager=true -Dtests.locale=yo -Dtests.timezone=Etc/GMT-10 -Dcompiler.java=12 -Druntime.java=11
// Muting test example:
// The name of the file which contains the failing test can be found by 2 components:
// - JdbcCsvSpecIT shows that it's a .csv-spec suffixed file
// - The name of the file is the part before the . so in our case: {pivot.testAverageWithOneValueAndLimit} => pivot
// Which in our example gives: pivot.csv-spec
//
// You can also find the whole name in the stacktrace of the exception along with the line where the failed test resides:
// at org.elasticsearch.xpack.sql.qa.single_node.JdbcCsvSpecIT.pivot.testAverageWithOneValueAndLimit(pivot.csv-spec:95)
//
//
// BEFORE (file: pivot.csv-spec):
//----------------------------------------------
// averageWithOneValueAndLimit
// schema::languages:bt|'F':d
// SELECT * FROM (SELECT languages, gender, salary FROM test_emp) PIVOT (AVG(salary) FOR gender IN ('F')) LIMIT 3;
//
// languages | 'F'
// ---------------+------------------
// null |62140.666666666664
// 1 |47073.25
// 2 |50684.4
// ;
//----------------------------------------------
//
//
// AFTER (muted), Just add the suffix -Ignore to the test name and a comment pointing to the Github issue:
//----------------------------------------------
// // AwaitsFix https://github.com/elastic/elasticsearch/issues/47080
// averageWithOneValueAndLimit-Ignore
// schema::languages:bt|'F':d
// SELECT * FROM (SELECT languages, gender, salary FROM test_emp) PIVOT (AVG(salary) FOR gender IN ('F')) LIMIT 3;
//
// languages | 'F'
// ---------------+------------------
// null |62140.666666666664
// 1 |47073.25
// 2 |50684.4
// ;
// ---------------------------------------------

View File

@ -6,3 +6,35 @@ name
SELECT COUNT(*) FROM "emp"; SELECT COUNT(*) FROM "emp";
// repeat the above // repeat the above
// Test failure example:
// org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT > test {agg.testGroupByOnText} FAILED
// org.h2.jdbc.JdbcSQLException: Column "gender2" not found; SQL statement:
// SELECT gender g FROM "test_emp" GROUP BY gender2 ORDER BY gender ASC [42122-197]
// at __randomizedtesting.SeedInfo.seed([880F4E292A732941:5B71F3848F44B9]:0)
// at org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT.agg.testGroupByOnText(agg.sql-spec:11)
// REPRODUCE WITH: ./gradlew ':x-pack:plugin:sql:qa:security:without-ssl:integTestRunner' --tests "org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT" -Dtests.method="test {agg.testGroupByOnText}" -Dtests.seed=BB1082EEC0023E5C -Dtests.security.manager=true -Dtests.locale=pt-TL -Dtests.timezone=MST7MDT -Dcompiler.java=12 -Druntime.java=12
// Muting test example:
// The name of the file which contains the failing test can be found by 2 components:
// - JdbcSqlSpecIT shows that it's a .sql-spec suffixed file
// - The name of the file is the part before the . so in our case: agg.testGroupByOnText => agg
// Which in our example gives: agg.sql-spec
//
// You can also find the whole name in the stacktrace of the exception along with the line where the failed test resides:
// at org.elasticsearch.xpack.sql.qa.security.JdbcSqlSpecIT.agg.testGroupByOnText(agg.sql-spec:11)
//
// BEFORE (file: agg.sql-spec):
//----------------------------------------------
// groupByOnText
// SELECT gender g FROM "test_emp" GROUP BY gender ORDER BY gender ASC;
//----------------------------------------------
//
//
// AFTER (muted), Just add the suffix -Ignore to the test name and a comment pointing to the Github issue:
//----------------------------------------------
// // AwaitsFix https://github.com/elastic/elasticsearch/issues/33519
// groupByOnText-Ignore
// SELECT gender g FROM "test_emp" GROUP BY gender ORDER BY gender ASC;
// ---------------------------------------------

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Tests testing field alias (introduced in ES 6.4) // Tests testing field alias (introduced in ES 6.4)
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Filter // Filter
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// Filter // Filter
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Full-text // Full-text
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
bitLengthGroupByAndOrderBy bitLengthGroupByAndOrderBy
SELECT BIT_LENGTH(first_name), COUNT(*) count FROM "test_emp" GROUP BY BIT_LENGTH(first_name) ORDER BY BIT_LENGTH(first_name) LIMIT 10; SELECT BIT_LENGTH(first_name), COUNT(*) count FROM "test_emp" GROUP BY BIT_LENGTH(first_name) ORDER BY BIT_LENGTH(first_name) LIMIT 10;

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Commands on geo test data // Commands on geo test data
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// Commands on geo test data // Commands on geo test data
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Tests for IP fields // Tests for IP fields
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// this one doesn't work in H2 at all // this one doesn't work in H2 at all
truncateWithAsciiHavingAndOrderBy truncateWithAsciiHavingAndOrderBy
SELECT TRUNCATE(ASCII(LEFT(first_name, 1)), 1), COUNT(*) count FROM test_emp GROUP BY ASCII(LEFT(first_name, 1)) HAVING COUNT(*) > 5 ORDER BY TRUNCATE(ASCII(LEFT(first_name, 1)), 1) DESC; SELECT TRUNCATE(ASCII(LEFT(first_name, 1)), 1), COUNT(*) count FROM test_emp GROUP BY ASCII(LEFT(first_name, 1)) HAVING COUNT(*) > 5 ORDER BY TRUNCATE(ASCII(LEFT(first_name, 1)), 1) DESC;

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// Math // Math
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Nested documents // Nested documents
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Null expressions // Null expressions
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// Null conditionals // Null conditionals
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Commands on OGC data // Commands on OGC data
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// Basic GEO SELECT // Basic GEO SELECT
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
averageWithOneValue averageWithOneValue
schema::languages:bt|'F':d schema::languages:bt|'F':d
SELECT * FROM (SELECT languages, gender, salary FROM test_emp) PIVOT (AVG(salary) FOR gender IN ('F')); SELECT * FROM (SELECT languages, gender, salary FROM test_emp) PIVOT (AVG(salary) FOR gender IN ('F'));

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// SELECT with = and != // SELECT with = and !=
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
// //
// Basic SELECT // Basic SELECT
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Geo-specific Sys Commands // Geo-specific Sys Commands
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Sys Commands // Sys Commands
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// Frozen indices tests // Frozen indices tests
// //

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.sql-spec
stringAscii stringAscii
SELECT ASCII(first_name) s FROM "test_emp" WHERE emp_no < 10010 ORDER BY emp_no; SELECT ASCII(first_name) s FROM "test_emp" WHERE emp_no < 10010 ORDER BY emp_no;

View File

@ -1,3 +1,5 @@
// To mute tests follow example in file: example.csv-spec
// //
// TIME // TIME
// //