Skip to content

Updating Optic tests based on Jenkins failures #1663

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

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,7 @@ public void testNegativePointInvalidValue() throws Exception {
result = e.getMessage();
}

String expectedResult = markLogicVersion.getMajor() <= 11 ?
"<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>" :
"arg2 is not of type xs:double";

String expectedResult = "<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>";
assertTrue(result.contains(expectedResult), "Unexpected result: " + result);
}

Expand Down Expand Up @@ -626,14 +623,8 @@ public void testNegativePointInvalidValue_ChildConstraint() throws Exception {
result = ex.getMessage();
}

String expectedResult = markLogicVersion.getMajor() <= 11 ?
"<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>" :
"arg2 is not of type xs:double";

assertTrue(
result.contains(expectedResult),
"Unexpected result: " + result
);
String expectedResult = "<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>";
assertTrue(result.contains(expectedResult), "Unexpected result: " + result);
}

@Test
Expand Down Expand Up @@ -820,10 +811,7 @@ public void testNegativePointInvalidValue_GeoElementConstraint() throws Exceptio
result = e.getMessage();
}

String expectedResult = markLogicVersion.getMajor() <= 11 ?
"<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>" :
"arg2 is not of type xs:double";

String expectedResult = "<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '12,A'.]</search:warning>";
assertTrue(result.contains(expectedResult), "Unexpected result: " + result);
}

Expand Down Expand Up @@ -1012,10 +1000,7 @@ public void testNegativePointInvalidValue_GeoElemPairConstraint() throws Excepti
result = e.getMessage();
}

String expectedResult = markLogicVersion.getMajor() <= 11 ?
"<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '-12,A'.]</search:warning>" :
"arg2 is not of type xs:double";

String expectedResult = "<search:warning id=\"SEARCH-IGNOREDQTEXT\">[Invalid text, cannot parse geospatial point from '-12,A'.]</search:warning>";
assertTrue(result.contains(expectedResult), "Unexpected result: " + result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2213,10 +2213,7 @@ public void testFromSqlUnionSelectOrderbyLimitOffset() {
.orderBy(op.desc("id"))
.limit(3)
.offset(1)
// This is no longer working on MarkLogic 12 nightly. Neither op.col("name") works now op.schemaCol("opticFunctionalTest.detail.name").
// We get an error of "Invalid arguments: expression column myName with undefined expression".
//.select(p.as("myName", p.col("name")))
;
.select(op.as("myName", op.col("name")));

JacksonHandle jacksonHandle = new JacksonHandle();
jacksonHandle.setMimetype("application/json");
Expand All @@ -2225,8 +2222,8 @@ public void testFromSqlUnionSelectOrderbyLimitOffset() {
JsonNode rows = result.path("rows");

assertEquals(2, rows.size());
assertEquals("Detail 5", rows.path(0).path("opticFunctionalTest.detail.name").path("value").asText());
assertEquals("Detail 4", rows.path(1).path("opticFunctionalTest.detail.name").path("value").asText());
assertEquals("Detail 5", rows.path(0).path("myName").path("value").asText());
assertEquals("Detail 4", rows.path(1).path("myName").path("value").asText());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public void insertDocsWithUserWithDefaultCollectionsAndPermissions() {
.write());

// Verify first doc inherits the default collections and permissions
// 2024-05-16 This started failing in the 15th due to the existence of the "collections" and "permissions"
// columns having null values. The server treats that as "Don't assign any collections/permissions" and thus
// the user's default ones are not applied.
verifyJsonDoc(firstUri, doc -> assertEquals("world", doc.get("hello").asText()));
verifyMetadata(firstUri, metadata -> {
DocumentMetadataHandle.DocumentPermissions perms = metadata.getPermissions();
Expand Down