MLE-26918 Fixing binary test on ARM, and bumping Gradle to 9.3.1#1911
MLE-26918 Fixing binary test on ARM, and bumping Gradle to 9.3.1#1911
Conversation
|
Copyright Validation Results ⏭️ Skipped (Excluded) Files
✅ Valid Files
✅ All files have valid copyright headers! |
The Gradle bump should "just work". Also hoping this triggers publication of the library internally, which doesn't seem to have happened for the last PR.
d7fb71c to
e94739b
Compare
There was a problem hiding this comment.
Pull request overview
This pull request upgrades Gradle from version 9.1.0 to 9.3.1 and fixes binary document tests on ARM architecture by disabling them when running on Linux aarch64 systems in Jenkins where MarkLogic converters are not available.
Changes:
- Upgraded Gradle wrapper from 9.1.0 to 9.3.1
- Added
@DisabledOnOsannotation to skiptestReadWriteon ARM/Linux due to unavailable MarkLogic converters - Removed empty
@AfterAllmethod from BinaryDocumentTest - Modified code formatting and visibility modifiers in BinaryDocumentTest
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| marklogic-client-api/src/test/java/com/marklogic/client/test/BinaryDocumentTest.java | Disabled test on ARM Linux, removed empty afterClass method, changed formatting and visibility modifiers |
| gradle/wrapper/gradle-wrapper.properties | Updated Gradle distribution URL from 9.1.0 to 9.3.1 |
| gradle/wrapper/gradle-wrapper.jar | Updated Gradle wrapper JAR binary to match version 9.3.1 |
Comments suppressed due to low confidence (4)
marklogic-client-api/src/test/java/com/marklogic/client/test/BinaryDocumentTest.java:98
- The test method visibility has been changed from 'public void' to package-private 'void', which deviates from the established convention in this codebase. Test methods throughout the codebase consistently use 'public' visibility. Consider changing this back to 'public void' to maintain consistency with other test methods.
void test_issue_758() {
marklogic-client-api/src/test/java/com/marklogic/client/test/BinaryDocumentTest.java:27
- The class visibility has been changed from 'public class' to package-private 'class', which deviates from the established convention in this codebase. The vast majority of test classes throughout the codebase use 'public class' visibility (e.g., TextDocumentTest, AlertingTest, and many others). Consider changing this back to 'public class' to maintain consistency with the rest of the test suite.
class BinaryDocumentTest {
marklogic-client-api/src/test/java/com/marklogic/client/test/BinaryDocumentTest.java:44
- The test method visibility has been changed from 'public void' to package-private 'void', which deviates from the established convention in this codebase. Test methods throughout the codebase consistently use 'public' visibility (e.g., in TextDocumentTest, AlertingTest, and others). Consider changing this back to 'public void' to maintain consistency with other test methods.
void testReadWrite() throws IOException, XpathException {
marklogic-client-api/src/test/java/com/marklogic/client/test/BinaryDocumentTest.java:113
- The indentation has been changed from spaces to tabs throughout the file, which deviates from the established convention in this codebase. The codebase consistently uses spaces (2 spaces per indentation level) for formatting, as seen in other test files like TextDocumentTest. Consider reverting to space-based indentation to maintain consistency with the rest of the codebase.
class BinaryDocumentTest {
@BeforeAll
public static void beforeClass() {
Common.connect();
}
// a simple base64-encoded binary
final static public String ENCODED_BINARY =
"iVBORw0KGgoAAAANSUhEUgAAAA0AAAATCAYAAABLN4eXAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oIEQEjMtAYogQAAAKvSURBVCjPlZLLbhxFAEVPVVdXVz/G8zCOn0CsKGyQkSIIKzas8xfsWbLkp/gJhCKheIlAJDaj2MYez6u7p7vrxQKUPVc6+yOdK77/4cfXQohJqlOVZdmBSpKY6jQKBM45oVMlgHvrvMuNWRljvlNKq69G2YyqLDg4mLE/2yPNYFRWlFXF/nTC2clRWbc7Fss1IcZzqTA8eWY5eu7p1Hv+WvyBVjnGZOQmI9UKISUqSXDO0bS7Tko0xfGSp18kjM7v+P3+NUMr8T5grWMYLCEErHM474khoCw1t78eU/8mEOpjXpxekJUORIZSCbkxSCnRWpPnBikTqbx31E1DjJHpeIzRhnW9xceI857H5Yr1Zku765jf3DIMtlUAIQRCiFhnabsOH1IEAmstAGWRY11ApykmM0oplTKZjNGZREpJoUueHI0ZFRV7exX7+1Nm0yn9YLm5u2fX96lUseLwxQ0vX8H04i2/XP9Et5H44OkHS920hBDo+56u77GDjcrHjvV1ya3TDO2M01mOUAEAhED+R5IkpKmCiFCOjoc/p+xuLbPpCc+P95HaEqIBIhHoB8t2W/PwsKBudl5FH7GxwUYYouJh5ci7nLbtWW02LBaPvLuef1AdrItKKolJpkivwGrG5QxTCsq8pCxLqqrk7PiIwTmW6y0xRCVTSg4vFnz+raM4+5ur1RtSUZHnOUWeMx5VVFWJTlOstfTWRuk96NIyOUgRRc188RZvgRg/3OffjoFESohxUMvmjqufP+X+MqDTU77+5EvMKKBUQpZpijxHSkluDHvjMW8uL79Rnz07bwSyzDLFqCzwDNw/PNI0O9bbhvVmQ7vb0bQdi+Wq327rl+rko8krodKnCHnofJju+r5oupBstg1KJT7Vuruev185O9zVm/WVUmouYoz83/0DxhRmafe2kasAAAAASUVORK5CYII=";
final static public byte[] BYTES_BINARY = DatatypeConverter.parseBase64Binary(ENCODED_BINARY);
@Test
// Requires MarkLogic 11 or higher now that we're using Docker; the INSTALL_CONVERTERS flag does not work for MarkLogic 10.
@ExtendWith(RequiresML11.class)
@DisabledOnOs(value = OS.LINUX, architectures = "aarch64", disabledReason = "MarkLogic converters not available when " +
"ARM regression tests are run in Jenkins.")
void testReadWrite() throws IOException, XpathException {
String docId = "/test/binary-sample.png";
String mimetype = "image/png";
for (int i : new int[]{0, 1}) {
BinaryDocumentManager docMgr = Common.client.newBinaryDocumentManager();
docMgr.setMetadataExtraction(MetadataExtraction.PROPERTIES);
BytesHandle handle = new BytesHandle().with(BYTES_BINARY).withMimetype(mimetype);
switch (i) {
case 0:
docMgr.write(docId, handle);
break;
case 1:
docMgr.write(docMgr.newWriteSet().add(docId, handle));
break;
default:
fail("unknown case: " + i);
}
DocumentDescriptor desc = docMgr.exists(docId);
assertTrue(desc.getByteLength() != DocumentDescriptor.UNKNOWN_LENGTH);
assertEquals(BYTES_BINARY.length, desc.getByteLength());
byte[] buf = docMgr.read(docId, new BytesHandle()).get();
assertEquals(BYTES_BINARY.length, buf.length);
buf = Common.streamToBytes(docMgr.read(docId, new InputStreamHandle()).get());
assertTrue(buf.length > 0);
switch (i) {
case 0:
handle = new BytesHandle();
buf = docMgr.read(docId, handle, 9, 10).get();
assertEquals(10, buf.length);
assertEquals(10, handle.getByteLength());
break;
case 1:
break;
default:
fail("unknown case: " + i);
}
docMgr.setMetadataCategories(Metadata.PROPERTIES);
Document metadataDocument = docMgr.readMetadata(docId, new DOMHandle()).get();
assertXpathEvaluatesTo("image/png", "string(/*[local-name()='metadata']/*[local-name()='properties']/*[local-name()='content-type'])", metadataDocument);
assertXpathEvaluatesTo("text HD-HTML", "string(/*[local-name()='metadata']/*[local-name()='properties']/*[local-name()='filter-capabilities'])", metadataDocument);
assertXpathEvaluatesTo("815", "string(/*[local-name()='metadata']/*[local-name()='properties']/*[local-name()='size'])", metadataDocument);
docMgr.delete(docId);
}
}
@Test
void test_issue_758() {
BinaryDocumentManager docMgr = Common.client.newBinaryDocumentManager();
DocumentWriteSet writeset = docMgr.newWriteSet();
FileHandle h1 = new FileHandle(new File(
"../marklogic-client-api-functionaltests/src/test/java/com/marklogic" +
"/client" +
"/functionaltest/data" +
"/Sega-4MB.jpg"));
String uri = "BinaryDocumentTest_" + new Random().nextInt(10000) + "/" + "Sega-4MB.jpg";
writeset.add(uri, h1);
docMgr.write(writeset);
DocumentPage page = docMgr.read(uri);
DocumentRecord rec = page.next();
assertNotNull(rec);
assertEquals(rec.getFormat(), Format.BINARY);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The Gradle bump should "just work".
Also hoping this triggers publication of the library internally, which doesn't seem to have happened for the last PR.