Add kafka buffer backward compatibility test#6406
Conversation
e17dfda to
273b69c
Compare
Signed-off-by: Taylor Gray <tylgry@amazon.com>
273b69c to
55b0a31
Compare
dlvenable
left a comment
There was a problem hiding this comment.
Nice work. This looks like it will work well.
At a high level, we should improve the name:
- The naming doesn't imply that this is the Kafka buffer. We also support a source and a nascent sink.
- Do we really need to explicitly use "backward" as we have not forward compatibility implied?
Maybe call the project kafka-buffer-compatibility and name the task kafkaBufferCompatibilityTest.
| * by writing data with a released version and reading with the current build. | ||
| */ | ||
|
|
||
| def RELEASED_VERSION = project.hasProperty('backwardCompatVersion') ? |
There was a problem hiding this comment.
Let's avoid abbreviations like "compat". I think releasedVersion would also be a better name for the property.
-PreleasedVersion=2.13.0
But, we can also use backwardCompatibilityVersion.
| buffer: | ||
| kafka: | ||
| topics: | ||
| - name: backward-compat-test-topic |
There was a problem hiding this comment.
backward-compatibility-test-topic
| kafka: | ||
| topics: | ||
| - name: backward-compat-test-topic | ||
| group_id: backward-compat-reader-group |
There was a problem hiding this comment.
backward-compatibility-reader-group
| username: "admin" | ||
| password: "admin" | ||
| insecure: true | ||
| index: "backward-compat-test-index" |
There was a problem hiding this comment.
kafka-backward-compatibility-test-index
Since this is an OpenSearch domain, it is probably best to scope with kafka as well.
| } | ||
|
|
||
| // Clean up tasks - remove any existing containers/networks before starting | ||
| tasks.register('cleanupKafkaBackwardCompatTest') { |
There was a problem hiding this comment.
| tasks.register('cleanupKafkaBackwardCompatTest') { | |
| tasks.register('cleanupKafkaBackwardCompatibilityTest') { |
| 3. Both messages appear in OpenSearch with correct content | ||
| 4. Test completes with ✅ SUCCESS message | ||
|
|
||
| ## CI/CD Integration |
| */ | ||
|
|
||
| def RELEASED_VERSION = project.hasProperty('backwardCompatVersion') ? | ||
| project.getProperty('backwardCompatVersion') : '2.10.0' |
There was a problem hiding this comment.
Why not 2.13.0?
Also, we should have 2 as an alias for the last released 2.x Data Prepper. That may be a better default.
There was a problem hiding this comment.
I'm going to use '2' so it always gets the latest release
| private static final int WRITER_HTTP_PORT = 2021; | ||
| private static final String TEST_INDEX_NAME = "backward-compat-test-index"; | ||
| private static final String MESSAGE_KEY = "message"; | ||
| private static final String TEST_VALUE_1 = "test-record-1-from-released-version"; |
There was a problem hiding this comment.
We should be able to generate these values in @BeforeEach instead.
You can make them somewhat random as well:
testValue1 = "test-record-1-from-released-version" + UUID.randomUUID.toString();
| import com.linecorp.armeria.common.MediaType; | ||
| import com.linecorp.armeria.common.RequestHeaders; | ||
| import com.linecorp.armeria.common.SessionProtocol; | ||
| import org.junit.Assert; |
There was a problem hiding this comment.
No JUnit 4. Please replace with JUnit 5.
| builder.withUsername("admin"); | ||
| builder.withPassword("admin"); | ||
| builder.withInsecure(true); | ||
| final AwsCredentialsSupplier awsCredentialsSupplier = mock(AwsCredentialsSupplier.class); |
Signed-off-by: Taylor Gray <tylgry@amazon.com>
cdbdac1 to
b0b5fa6
Compare
Signed-off-by: Taylor Gray <tylgry@amazon.com>
Signed-off-by: Taylor Gray <tylgry@amazon.com>
Signed-off-by: Taylor Gray <tylgry@amazon.com> Signed-off-by: Simon ELBAZ <elbazsimon9@gmail.com>
Signed-off-by: Taylor Gray <tylgry@amazon.com>
Signed-off-by: Taylor Gray <tylgry@amazon.com>
Description
This change adds an end to end test to data prepper for testing kafka buffer backward compatibility. The steps of the test are
delayso that those records are not consumed from the bufferCheck List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.