Skip to content

Commit

Permalink
Setup to make oats tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
marctc committed May 31, 2024
1 parent b3a6668 commit 122b47f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ oats-test-sql-other-langs: oats-prereq
.PHONY: oats-test-kafka-other-langs
oats-test-kafka-other-langs: oats-prereq
mkdir -p test/oats/kafka_other_langs/$(TEST_OUTPUT)/run
cd test/oats/kafka_other_langs && TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
cd test/oats/kafka_other_langs && TESTCASE_TIMEOUT=120s TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r

.PHONY: oats-test
oats-test: oats-test-sql oats-test-sql-statement oats-test-sql-other-langs oats-test-kafka-other-langs
Expand Down
1 change: 1 addition & 0 deletions test/integration/components/pythonkafka/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def do_GET(self):
self.send_header('Content-type', 'application/json')
self.end_headers()
message = kafka_service.fetch_message()
logger.info(f"Sending message: {message}")
self.wfile.write(json.dumps(message).encode('utf-8'))
else:
self.send_response(404)
Expand Down
3 changes: 2 additions & 1 deletion test/oats/kafka_other_langs/docker-compose-beyla-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
image: docker.io/bitnami/kafka:3.3
ports:
- "9093:9093"
- "9092:9092"
volumes:
- "kafka-volume:/bitnami"
environment:
Expand All @@ -23,7 +24,7 @@ services:
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_LISTENERS=CLIENT://:9092,EXTERNAL://:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://localhost:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://kafka:9092,EXTERNAL://kafka:9093
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=CLIENT
depends_on:
- zookeeper
Expand Down
7 changes: 4 additions & 3 deletions test/oats/kafka_other_langs/yaml/oats_kafka.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ docker-compose:
input:
- path: '/message'

interval: 500ms
interval: 2s
expected:
traces:
- traceql: '{ .message.kafka.operation = "receive" }'
- traceql: '{ .messaging.operation = "receive" }'
spans:
- name: 'example_topic receive'
attributes:
messaging.destination.name: example_topic
message.kafka.operation: receive
messaging.operation: receive
messaging.system: kafka
# metrics:
# - promql: 'sql_client_duration_sum'
# value: "> 0"
Expand Down

0 comments on commit 122b47f

Please sign in to comment.