-
-
Notifications
You must be signed in to change notification settings - Fork 867
debezium/dbz#1810 Add automated E2E tests for the auditlog example. #406
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
Open
KMohnishM
wants to merge
1
commit into
debezium:main
Choose a base branch
from
KMohnishM:dbz-1810
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
auditlog/admin-service/src/main/java/io/debezium/demos/auditing/admin/VegetableData.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| name: auditlog | ||
| description: Tests Debezium PostgreSQL connector with audit log enrichment via Kafka Streams | ||
| env_file: ../.env | ||
| compose_file: docker-compose.yaml | ||
|
|
||
| cleanup: | ||
| type: docker_compose_down | ||
| volumes: true | ||
|
|
||
| steps: | ||
| - name: Build all images | ||
| type: docker_compose_build | ||
|
|
||
| - name: Start all services | ||
| type: docker_compose_up | ||
| detach: true | ||
|
|
||
| - name: Wait for Kafka Connect REST API to be ready | ||
| type: http_wait | ||
| url: http://localhost:8083/connectors | ||
| timeout_seconds: 120 | ||
| interval_seconds: 5 | ||
|
|
||
| - name: Register Debezium PostgreSQL connector | ||
| type: http_put | ||
| url: http://localhost:8083/connectors/inventory-connector/config | ||
| body_file: register-postgres.json | ||
| expected_status: [200, 201] | ||
|
|
||
| - name: Wait for connector to be RUNNING | ||
| type: http_wait | ||
| url: http://localhost:8083/connectors/inventory-connector/status | ||
| timeout_seconds: 60 | ||
| interval_seconds: 5 | ||
| expected_json_path: connector.state | ||
| expected_value: RUNNING | ||
|
|
||
| - name: Wait for vegetables-service to be ready | ||
| type: http_wait | ||
| url: http://localhost:8080/vegetables | ||
| timeout_seconds: 120 | ||
| interval_seconds: 5 | ||
| expected_status: [200, 405] | ||
|
|
||
| - name: Wait for admin-service to be ready | ||
| type: http_wait | ||
| url: http://localhost:8085/vegetables | ||
| timeout_seconds: 60 | ||
| interval_seconds: 5 | ||
| expected_status: 200 | ||
|
|
||
| - name: Create a new vegetable record (farmerbob) | ||
| type: http_post | ||
| url: http://localhost:8080/vegetables | ||
| headers: | ||
| Authorization: "Bearer eyJraWQiOiJqd3Qua2V5IiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmYXJtZXJib2IiLCJ1cG4iOiJmYXJtZXJib2IiLCJhdXRoX3RpbWUiOjE1NjY0NTgxMTMsImlzcyI6ImZhcm1zaG9wIiwiZ3JvdXBzIjpbImZhcm1lcnMiLCJjdXN0b21lcnMiXSwiZXhwIjo0MTAyNDQ0Nzk5LCJpYXQiOjE1NjY0NTgxMTMsImp0aSI6IjQyIn0.CscbJN8amqKryYvnVO1184J8F67HN2iTEjVN2VOPodcnoeOd7_iQVKUjC3h-ye5apkJjvAsQKrjzlrGCHRfl-n6jC9F7IkOtjoWnJ4wQ9BBo1SAtPw_Czt1I_Ujm-Kb1p5-BWACCBCVVFgYZTWP_laz5JZS7dIvs6VqoNnw7A4VpA6iPfTVfYlNY3u86-k1FvEg_hW-N9Y9RuihMsPuTdpHK5xdjCrJiD0VJ7-0eRQ8RXpycHuHN4xfmV8MqXBYjYSYDOhbnYbdQVbf0YJoFFqfb75my5olN-97ITsi2MS62W_y-RNT0qZrbytqINA3fF3VQsSY6VcaqRAeygrKm_Q" | ||
| Date: "Mon, 20 Apr 2026 12:00:00 GMT" | ||
| body: | ||
| name: "Cucumber" | ||
| description: "Fresh and crunchy" | ||
| expected_status: [200, 201, 204] | ||
|
|
||
| - name: Verify enriched message appears in Kafka | ||
| type: kafka_consume | ||
| topic: dbserver1.inventory.vegetable.enriched | ||
| timeout_seconds: 60 | ||
| expected_content: "Cucumber" | ||
|
|
||
| - name: Verify metadata enrichment (user farmerbob) | ||
| type: kafka_consume | ||
| topic: dbserver1.inventory.vegetable.enriched | ||
| timeout_seconds: 30 | ||
| expected_content: "farmerbob" | ||
|
|
||
| - name: Administrate missing events - Create a record bypassing the service | ||
| type: docker_compose_exec | ||
| service: vegetables-db | ||
| command: "psql postgresql://postgresuser:postgrespw@vegetables-db:5432/vegetablesdb -c \"insert into inventory.vegetable (id, description, name) values (nextval('inventory.vegetables_id_seq'), 'Tasty!', 'Banana');\"" | ||
|
|
||
| - name: Verify raw anomalous event appears in Kafka | ||
| type: kafka_consume | ||
| service: kafka | ||
| topic: dbserver1.inventory.vegetable | ||
| expected_content: "Banana" | ||
| timeout_seconds: 60 | ||
|
|
||
| - name: Wait for missing event to appear in admin service | ||
| type: http_wait | ||
| url: http://localhost:8085/vegetables | ||
| timeout_seconds: 120 | ||
| interval_seconds: 5 | ||
| expected_status: 200 | ||
| expected_json_path: 0.id | ||
| expected_value: "{ANY}" | ||
| capture_json: | ||
| MISSING_UUID: "0.id" | ||
|
|
||
| - name: Get list of tasks to provide missing data | ||
| type: http_wait | ||
| url: http://localhost:8085/vegetables/${MISSING_UUID}/tasks | ||
| timeout_seconds: 30 | ||
| interval_seconds: 5 | ||
| expected_status: 200 | ||
| expected_json_path: "{FIRST_KEY}" | ||
| expected_value: "{ANY}" | ||
| capture_json: | ||
| TASK_UUID: "{FIRST_KEY}" | ||
|
|
||
| - name: Provide missing metadata to the admin service | ||
| type: http_post | ||
| url: http://localhost:8085/vegetables/${MISSING_UUID}/auditData/${TASK_UUID} | ||
| expected_status: [200, 201] | ||
| body: | ||
| audit: | ||
| usecase: "CREATE VEGETABLE" | ||
| user_name: "farmerjohn" | ||
|
|
||
| - name: Verify enriched message appears in Kafka (from admin resolution) | ||
| type: kafka_consume | ||
| topic: dbserver1.inventory.vegetable.enriched | ||
| timeout_seconds: 60 | ||
| expected_content: "Banana" | ||
|
|
||
| - name: Verify metadata enrichment (user farmerjohn) | ||
| type: kafka_consume | ||
| topic: dbserver1.inventory.vegetable.enriched | ||
| timeout_seconds: 30 | ||
| expected_content: "farmerjohn" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This
kafka_consumestep setsservice: kafka, but the runner currently hard-codes the Kafka service name tokafkaand ignores anyservicefield. Either remove this field from the YAML (to avoid suggesting it has an effect) or extendstep_kafka_consumeto honor an optionalserviceoverride.