Skip to content

Commit

Permalink
--wip-- [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren committed Nov 3, 2023
1 parent 55822bf commit 6529d14
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 58 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ jobs:
- name: Run tracetests
run: |
export TRACETEST_TOKEN=${{ secrets.TRACETEST_TOKEN }}
tracetest run -vv \
tracetest run \
--config ./tracetest/config/tracetest-cloud.yaml \
--file ./tracetest/tests/testsuite.yaml
--file ./tracetest/tests/testsuite.yaml \
--vars ./tracetest/tests/vars.agent.yaml
96 changes: 50 additions & 46 deletions docker-compose.agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,35 @@ services:
interval: 1s
timeout: 5s
retries: 60
# stream:
# image: confluentinc/cp-kafka:latest-ubi8
# environment:
# - KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://stream:9092,PLAINTEXT_HOST://127.0.0.1:29092
# - KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093,PLAINTEXT_HOST://:29092
# - [email protected]:9093
# - KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER
# - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
# - KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
# - KAFKA_PROCESS_ROLES=controller,broker
# - KAFKA_NODE_ID=1
# - KAFKA_METADATA_LOG_SEGMENT_MS=15000
# - KAFKA_METADATA_MAX_RETENTION_MS=60000
# - KAFKA_METADATA_LOG_MAX_RECORD_BYTES_BETWEEN_SNAPSHOTS=2800
# - KAFKA_AUTO_CREATE_TOPICS_ENABLE=true
# - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
# - KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1
# - KAFKA_HEAP_OPTS=-Xmx200m -Xms200m
# - CLUSTER_ID=ckjPoprWQzOf0-FuNkGfFQ
# healthcheck:
# test: nc -z stream 9092
# start_period: 10s
# interval: 5s
# timeout: 10s
# retries: 10

stream:
image: confluentinc/cp-kafka:latest-ubi8
ports:
- 29092:29092
- 9092:9092
environment:
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://stream:9092,PLAINTEXT_HOST://127.0.0.1:29092
- KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093,PLAINTEXT_HOST://:29092
- [email protected]:9093
- KAFKA_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
- KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
- KAFKA_PROCESS_ROLES=controller,broker
- KAFKA_NODE_ID=1
- KAFKA_METADATA_LOG_SEGMENT_MS=15000
- KAFKA_METADATA_MAX_RETENTION_MS=60000
- KAFKA_METADATA_LOG_MAX_RECORD_BYTES_BETWEEN_SNAPSHOTS=2800
- KAFKA_AUTO_CREATE_TOPICS_ENABLE=true
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR=1
- KAFKA_HEAP_OPTS=-Xmx200m -Xms200m
- CLUSTER_ID=ckjPoprWQzOf0-FuNkGfFQ
healthcheck:
test: nc -z stream 9092
start_period: 10s
interval: 5s
timeout: 10s
retries: 10

api:
image: kubeshop/demo-pokemon-api:latest
Expand Down Expand Up @@ -100,24 +104,24 @@ services:
queue:
condition: service_healthy

# streaming-worker:
# image: kubeshop/demo-pokemon-api:latest
# extra_hosts:
# - "host.docker.internal:host-gateway"
# environment:
# DATABASE_URL: postgresql://ashketchum:squirtle123@db:5432/pokeshop?schema=public
# POKE_API_BASE_URL: https://pokeapi.co/api/v2
# COLLECTOR_ENDPOINT: http://host.docker.internal:4317
# ZIPKIN_URL: http://localhost:9411
# NPM_RUN_COMMAND: stream-worker
# KAFKA_BROKER: 'stream:9092'
# KAFKA_TOPIC: 'pokemon'
# KAFKA_CLIENT_ID: 'streaming-worker'
# REDIS_URL: cache
# depends_on:
# db:
# condition: service_healthy
# stream:
# condition: service_healthy
# cache:
# condition: service_healthy
streaming-worker:
image: kubeshop/demo-pokemon-api:latest
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
DATABASE_URL: postgresql://ashketchum:squirtle123@db:5432/pokeshop?schema=public
POKE_API_BASE_URL: https://pokeapi.co/api/v2
COLLECTOR_ENDPOINT: http://host.docker.internal:4317
ZIPKIN_URL: http://localhost:9411
NPM_RUN_COMMAND: stream-worker
KAFKA_BROKER: 'stream:9092'
KAFKA_TOPIC: 'pokemon'
KAFKA_CLIENT_ID: 'streaming-worker'
REDIS_URL: cache
depends_on:
db:
condition: service_healthy
stream:
condition: service_healthy
cache:
condition: service_healthy
8 changes: 5 additions & 3 deletions tracetest/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ services:
- type: bind
source: ./tracetest/config/tracetest-cli.yaml
target: /app/tracetest-cli.yaml
entrypoint:
entrypoint:
- tracetest
command:
command:
- run
- testsuite
- --config
- /app/tracetest-cli.yaml
- --file
- /app/tracebased-tests/testsuite.yaml
- --vars
- /app/tracebased-tests/vars.docker.yaml
depends_on:
tracetest-server:
condition: service_healthy

tracetest-server:
image: kubeshop/tracetest:${TAG:-latest}
volumes:
Expand Down
2 changes: 1 addition & 1 deletion tracetest/tests/add.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
type: http
httpRequest:
method: POST
url: http://api:8081/pokemon
url: http://${var:API_HOST}/pokemon
body: |
{
"name": "meowth",
Expand Down
2 changes: 1 addition & 1 deletion tracetest/tests/importqueue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
type: http
httpRequest:
method: POST
url: http://api:8081/pokemon/import
url: http://${var:API_HOST}/pokemon/import
body: |
{
"id": 143
Expand Down
4 changes: 2 additions & 2 deletions tracetest/tests/importstream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
type: kafka
kafka:
brokerUrls:
- stream:9092
- ${env:KAFKA_HOST}
topic: pokemon
headers: []
messageKey: snorlax-key
Expand All @@ -20,4 +20,4 @@ spec:
- selector: span[tracetest.span.type="general" name="import pokemon"]
name: Import Pokemon use case was triggered
assertions:
- attr:name = "import pokemon"
- attr:name = "import pokemon"
2 changes: 1 addition & 1 deletion tracetest/tests/list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
type: http
httpRequest:
method: GET
url: http://api:8081/pokemon?take=20&skip=0
url: http://${var:API_HOST}/pokemon?take=20&skip=0
headers:
- key: Content-Type
value: application/json
Expand Down
4 changes: 2 additions & 2 deletions tracetest/tests/testsuite.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type: Transaction
type: TestSuite
spec:
id: ILYjqDQ4g
name: Running all tests
Expand All @@ -7,4 +7,4 @@ spec:
- ./add.yaml
- ./importqueue.yaml
- ./importstream.yaml
- ./list.yaml
- ./list.yaml
9 changes: 9 additions & 0 deletions tracetest/tests/vars.agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: VariableSet
spec:
id: agent
name: Agent Values
values:
- key: API_HOST
value: localhost:8081
- key: KAFKA_HOST
value: localhost:9092
9 changes: 9 additions & 0 deletions tracetest/tests/vars.docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: VariableSet
spec:
id: docker
name: Docker Values
values:
- key: API_HOST
value: api:8081
- key: KAFKA_HOST
value: stream:9092

0 comments on commit 6529d14

Please sign in to comment.