Skip to content
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

[8.x] Enable test-fixture test suites (#117329) #117340

Merged
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
9 changes: 0 additions & 9 deletions test/fixtures/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +0,0 @@

subprojects {
// fixtures don't have tests, these are external projects used by the build
pluginManager.withPlugin('java') {
tasks.named('test').configure {
enabled = false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import java.util.List;
import java.util.Objects;

import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.greaterThan;

public class S3HttpHandlerTests extends ESTestCase {
Expand Down Expand Up @@ -261,7 +263,7 @@ public void testListAndAbortMultipartUpload() {
<Delimiter /><Prefix>path/blob</Prefix><MaxUploads>10000</MaxUploads><IsTruncated>false</IsTruncated>\
</ListMultipartUploadsResult>"""), handleRequest(handler, "GET", "/bucket/?uploads&prefix=path/blob"));

assertEquals(RestStatus.NOT_FOUND, handleRequest(handler, "POST", "/bucket/path/blob?uploadId=" + uploadId, Strings.format("""
final var completeUploadResponse = handleRequest(handler, "POST", "/bucket/path/blob?uploadId=" + uploadId, Strings.format("""
<?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Part>
Expand All @@ -272,7 +274,13 @@ public void testListAndAbortMultipartUpload() {
<ETag>%s</ETag>
<PartNumber>2</PartNumber>
</Part>
</CompleteMultipartUpload>""", part1Etag, part2Etag)).status());
</CompleteMultipartUpload>""", part1Etag, part2Etag));
if (completeUploadResponse.status() == RestStatus.OK) {
// possible, but rare, indicating that S3 started processing the upload before returning an error
assertThat(completeUploadResponse.body().utf8ToString(), allOf(containsString("<Error>"), containsString("NoSuchUpload")));
} else {
assertEquals(RestStatus.NOT_FOUND, completeUploadResponse.status());
}
}

private static String getUploadId(BytesReference createUploadResponseBody) {
Expand Down