-
Notifications
You must be signed in to change notification settings - Fork 497
feat: add tabletopic e2e case #2827
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
Conversation
… evolution and broker restart scenarios
d445cf8
to
25d1466
Compare
…run command in ducker-ak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive end-to-end testing capability for the TableTopic feature in AutoMQ. It introduces random Avro value generation, establishes a base test framework with external service management, and implements multiple test scenarios to validate TableTopic functionality under various conditions.
- Adds random Avro value generation to PerfCommand for schema-based testing without requiring predefined value files
- Creates a comprehensive TableTopic test framework with base services and helper methods
- Implements multiple test scenarios including schema evolution, partition reassignment, broker restarts, and matrix testing
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
tools/src/main/java/org/apache/kafka/tools/automq/PerfCommand.java | Adds random Avro value generation functionality with comprehensive schema type support |
tools/src/main/java/org/apache/kafka/tools/automq/perf/PerfConfig.java | Removes --values-random option, defaulting to random generation when no values file is provided |
tests/kafkatest/tests/core/automq_tabletopic_base.py | Base test framework providing service lifecycle management and common test utilities |
tests/kafkatest/tests/core/automq_tabletopic_e2e_test.py | Basic end-to-end test validating core TableTopic functionality |
tests/kafkatest/tests/core/automq_tabletopic_schema_evolution_test.py | Tests schema evolution across multiple compatible Avro schema versions |
tests/kafkatest/tests/core/automq_tabletopic_partition_reassignment_test.py | Tests partition reassignment during active data production |
tests/kafkatest/tests/core/automq_tabletopic_broker_restart_test.py | Tests broker restart scenarios with continuous data flow |
tests/kafkatest/tests/core/automq_tabletopic_matrix_test.py | Matrix testing for different configurations and topic counts |
tests/kafkatest/services/performance/automq_performance.py | Performance service wrapper for AutoMQ PerfCommand with Avro support |
tests/kafkatest/services/external_services.py | Docker Compose service management for external dependencies |
tests/docker/ | Docker configuration files for Schema Registry and Iceberg Catalog services |
tests/docker/ducker-ak | Modified to enable Docker-in-Docker for ducker01 node |
tests/docker/Dockerfile | Adds Docker installation to test container |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
tests/kafkatest/tests/core/automq_tabletopic_partition_reassignment_test.py
Show resolved
Hide resolved
env_prefix += f"{key}='{value}' " | ||
|
||
# Use sudo -E to preserve environment variables for the docker compose command. | ||
cmd = f"{env_prefix} sudo -E docker compose -f {self.compose_file_path} {command}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using shell=True with user-controlled input in subprocess.check_call is a security risk. Consider using subprocess.run with a list of arguments instead of shell=True.
Copilot uses AI. Check for mistakes.
* feat(perf): implement random Avro value generation for performance testing * feat(e2e): implement end-to-end tests for Table Topic feature with Avro messages * feat(tests): add end-to-end tests for Table Topic feature with schema evolution and broker restart scenarios * fix(docker): streamline Docker installation in Dockerfile and update run command in ducker-ak * fix(config): update S3 bucket name for Iceberg catalog in configuration
* feat(perf): implement random Avro value generation for performance testing * feat(e2e): implement end-to-end tests for Table Topic feature with Avro messages * feat(tests): add end-to-end tests for Table Topic feature with schema evolution and broker restart scenarios * fix(docker): streamline Docker installation in Dockerfile and update run command in ducker-ak * fix(config): update S3 bucket name for Iceberg catalog in configuration
Background
Components
KafkaService
(KRaft mode, 3 nodes).DockerComposeService
to start Schema Registry (10.5.1.3:8081) and Iceberg Catalog (10.5.1.4:8181).AutoMQPerformanceService
wrapsbin/automq-perf-test.sh
(org.apache.kafka.tools.automq.PerfCommand
).Core Flow
KAFKA_BOOTSTRAP_SERVERS
)._wait_for_service
polls Catalog/v1/config
and Registry root path; proceeds after READY status.AutoMQPerformanceService
to send Avro data; configure topic/producer parameters required by TableTopic._sum_kafka_end_offsets_stable
) as produced count;produceCountTotal
from perf is only for log comparison.total-records
, compare with expected record count; on failure, print detailed context info.New test cases added (asserting consistency: Kafka offsets == Iceberg total-records)