Skip to content

Commit

Permalink
Enable ignored and disabled tests (opensearch-project#926)
Browse files Browse the repository at this point in the history
- Enabled ignored and disabled tests.
- Created opensearch-project#922, opensearch-project#917, opensearch-project#912, opensearch-project#910 and attached them to disabled tests for traceability.
- Removed irrelevant tests.
  • Loading branch information
Guian Gumpac authored Oct 28, 2022
1 parent d46b389 commit 3fd53ca
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ public void remove_source() {
AstDSL.field("double_value")));
}

@Disabled("the project/remove command should shrink the type env")
@Disabled("the project/remove command should shrink the type env. Should be enabled once "
+ "https://github.com/opensearch-project/sql/issues/917 is resolved")
@Test
public void project_source_change_type_env() {
SemanticCheckException exception =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@ public void named_expression_with_alias() {
);
}

@Disabled("we didn't define the aggregator symbol any more")
@Test
public void named_expression_with_delegated_expression_defined_in_symbol_table() {
analysisContext.push();
analysisContext.peek().define(new Symbol(Namespace.FIELD_NAME, "AVG(integer_value)"), FLOAT);

assertAnalyzeEqual(
DSL.named("AVG(integer_value)", DSL.ref("AVG(integer_value)", FLOAT)),
AstDSL.alias("AVG(integer_value)",
AstDSL.aggregate("AVG", AstDSL.qualifiedName("integer_value")))
);
}

@Test
public void field_name_with_qualifier() {
analysisContext.peek().define(new Symbol(Namespace.INDEX_NAME, "index_alias"), STRUCT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1307,8 +1307,6 @@ public void distinctWithOneField() {
);
}

@Ignore("Skip this because it compares result of GROUP BY and DISTINCT and find difference in\n"
+ "schema type (string and text). Remove this when DISTINCT supported in new engine.")
@Test
public void distinctWithMultipleFields() {
Assert.assertEquals(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected Request getSqlRequest(String request, boolean explain) {
return sqlRequest;
}

@Ignore("Index type is removed in OpenSearch 7+")
// This is testing a deprecated feature
@Test
public void wrongIndexType() throws IOException {
String type = "wrongType";
Expand Down Expand Up @@ -248,9 +248,6 @@ public void groupBySingleField() throws IOException {
assertContainsData(getDataRows(response), fields);
}

@Ignore("The semantic of this and previous are wrong. The correct semantic is that * will "
+ "be expanded to all fields of the index. Error should be raise for both due to difference "
+ "between columns in SELECT and GROUP BY.")
@Test
public void groupByMultipleFields() throws IOException {
JSONObject response = executeQuery(
Expand Down Expand Up @@ -398,7 +395,6 @@ public void aggregationFunctionInHaving() throws IOException {
// public void nestedAggregationFunctionInSelect() {
// String query = String.format(Locale.ROOT, "SELECT SUM(SQRT(age)) FROM age GROUP BY age", TEST_INDEX_ACCOUNT);
// }
@Ignore("New engine returns string type")
@Test
public void fieldsWithAlias() throws IOException {
JSONObject response = executeQuery(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ private void assertResponseForSelectSpecificFields(JSONObject response,
}
}

@Ignore("Will fix this in issue https://github.com/opendistro-for-elasticsearch/sql/issues/121")
@Test
public void selectFieldWithSpace() throws IOException {
String[] arr = new String[] {"test field"};
Expand Down Expand Up @@ -574,7 +573,6 @@ public void notBetweenTest() throws IOException {
}
}

@Ignore("Semantic analysis failed because 'age' doesn't exist.")
@Test
public void inTest() throws IOException {
JSONObject response = executeQuery(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ public void selectFromSubqueryCountAndSum() throws IOException {
assertThat(result.query("/aggregations/balance/value"), equalTo(25714837.0));
}

@Ignore("Skip to avoid breaking test due to inconsistency in JDBC schema")
@Test
public void selectFromSubqueryWithoutAliasShouldPass() throws IOException {
JSONObject response = executeJdbcRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void testFieldsWithMultiFields() throws IOException {
verifyColumn(result, columnName("firstname"), columnName("lastname"));
}

@Ignore("Cannot resolve wildcard yet")
@Ignore("Cannot resolve wildcard yet. Enable once https://github.com/opensearch-project/sql/issues/787 is resolved.")
@Test
public void testFieldsWildCard() throws IOException {
JSONObject result =
Expand Down
10 changes: 0 additions & 10 deletions integ-test/src/test/java/org/opensearch/sql/ppl/MatchPhraseIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ public void test_match_phrase_function() throws IOException {
verifyDataRows(result, rows("quick fox"), rows("quick fox here"));
}

@Test
@Ignore("Not supported actually in PPL")
public void test_matchphrase_legacy_function() throws IOException {
JSONObject result =
executeQuery(
String.format(
"source=%s | where matchphrase(phrase, 'quick fox') | fields phrase", TEST_INDEX_PHRASE));
verifyDataRows(result, rows("quick fox"), rows("quick fox here"));
}

@Test
public void test_match_phrase_with_slop() throws IOException {
JSONObject result =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public void fieldsCommandShouldPassSemanticCheck() {
queryShouldPassSyntaxAndSemanticCheck(query);
}

@Ignore("Can't resolve target field yet")
@Test
public void renameCommandShouldPassSemanticCheck() {
String query =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void testRenameMultiField() throws IOException {
verifyColumn(result, columnName("FIRSTNAME"), columnName("AGE"));
}

@Ignore("Wildcard is unsupported yet")
@Ignore("Wildcard is unsupported yet. Enable once https://github.com/opensearch-project/sql/issues/787 is resolved.")
@Test
public void testRenameWildcardFields() throws IOException {
JSONObject result = executeQuery("source=" + TEST_INDEX_ACCOUNT + " | rename %name as %NAME");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public void testSortCommand() throws IOException {
verifyOrder(result, rows(28), rows(32), rows(33), rows(34), rows(36), rows(36), rows(39));
}

@Ignore("Order with duplicated value")
@Test
public void testSortWithNullValue() throws IOException {
JSONObject result =
Expand All @@ -43,9 +42,9 @@ public void testSortWithNullValue() throws IOException {
TEST_INDEX_BANK_WITH_NULL_VALUES));
verifyOrder(
result,
rows("Hattie"),
rows("Elinor"),
rows("Virginia"),
rows("Hattie", null),
rows("Elinor", null),
rows("Virginia", null),
rows("Dale", 4180),
rows("Nanette", 32838),
rows("Amber JOHnny", 39225),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ protected void init() throws Exception {
loadIndex(Index.ACCOUNT);
}

@Ignore("Will add this validation in analyzer later")
@Ignore("Will add this validation in analyzer later. This test should be enabled once " +
"https://github.com/opensearch-project/sql/issues/910 has been resolved")
@Test
public void testNonAggregatedSelectColumnMissingInGroupByClause() throws IOException {
expectResponseException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void aggregation_merge_filter_relation() {
);
}

@Disabled
@Disabled("This test should be enabled once https://github.com/opensearch-project/sql/issues/912 is fixed")
@Test
void aggregation_cant_merge_indexScan_with_project() {
assertEquals(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public void can_serialize_and_deserialize_predicates() {
assertEquals(original, actual);
}

@Disabled("Bypass until all functions become serializable")
@Test
public void can_serialize_and_deserialize_functions() {
Expression original = dsl.abs(literal(30.0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ public void testDataTypeFuncCall() {
));
}

@Ignore("Nested field is not supported in backend yet")
@Test
public void testNestedFieldName() {
assertEqual("source=t | fields field0.field1.field2",
Expand All @@ -553,7 +552,6 @@ public void testFieldNameWithSpecialChars() {
));
}

@Ignore("Nested field is not supported in backend yet")
@Test
public void testNestedFieldNameWithSpecialChars() {
assertEqual("source=t | fields `field-0`.`field#1`.`field*2`",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ void should_report_error_for_non_integer_ordinal_in_group_by() {
error.getMessage());
}

@Disabled("This validation is supposed to be in analyzing phase")
@Disabled("This validation is supposed to be in analyzing phase. This test should be enabled "
+ "once https://github.com/opensearch-project/sql/issues/910 has been resolved")
@Test
void should_report_error_for_mismatch_between_select_and_group_by_items() {
SemanticCheckException error1 = assertThrows(SemanticCheckException.class, () ->
Expand Down

0 comments on commit 3fd53ca

Please sign in to comment.