-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Refactor kafka integration tests to reduce flickers
- Loading branch information
1 parent
9effb5d
commit 0a2daed
Showing
7 changed files
with
141 additions
and
68 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
tests/Agent/IntegrationTests/ContainerApplications/docker-compose-kafka.yml
This file contains 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,71 @@ | ||
version: "3" | ||
|
||
# The following must be set either in environment variables or via a .env file in the same folder as this file: | ||
# | ||
# AGENT_PATH host path to the Agent linux home folder - will map to /usr/local/newrelic-dotnet-agent in the container | ||
# LOG_PATH host path for Agent logfile output - will map to /app/logs in the container | ||
# DISTRO_TAG distro tag for build, not including the architecture suffix - possible values 7.0-bullseye-slim, 7.0-alpine, 7.0-jammy | ||
# TARGET_ARCH the target architecture for the build and run -- either amd64 or arm64 | ||
# PORT external port for the smoketest API | ||
# CONTAINER_NAME The name for the container | ||
# PLATFORM The platform that the service runs on -- linux/amd64 or linux/arm64/v8 | ||
# DOTNET_VERSION The dotnet version number to use (7.0, 8.0, etc) | ||
# TEST_DOCKERFILE The path and dockerfile to use for the service. | ||
# | ||
# and the usual suspects: | ||
# NEW_RELIC_LICENSE_KEY | ||
# NEW_RELIC_HOST | ||
# NEW_RELIC_APP_NAME | ||
# | ||
# | ||
# To build and run, execute `docker compose -f <path to docker-compose.yml> up` | ||
# Alternatively, set COMPOSE_FILE environment variable to the path and omit the -f parameter | ||
|
||
services: | ||
UbuntuX64Kafka1TestApp: | ||
extends: | ||
file: docker-compose-smoketestapp.yml | ||
service: smoketestapp | ||
depends_on: | ||
- kafka-broker | ||
environment: | ||
- NEW_RELIC_KAFKA_TOPIC=${NEW_RELIC_KAFKA_TOPIC} | ||
- NEW_RELIC_KAFKA_CONTAINER_NAME=${NEW_RELIC_KAFKA_CONTAINER_NAME} | ||
|
||
UbuntuX64Kafka2TestApp: | ||
extends: | ||
file: docker-compose-smoketestapp.yml | ||
service: smoketestapp | ||
depends_on: | ||
- kafka-broker | ||
environment: | ||
- NEW_RELIC_KAFKA_TOPIC=${NEW_RELIC_KAFKA_TOPIC} | ||
- NEW_RELIC_KAFKA_CONTAINER_NAME=${NEW_RELIC_KAFKA_CONTAINER_NAME} | ||
|
||
kafka-broker: | ||
image: confluentinc/cp-kafka:7.5.0 | ||
# container_name: ${NEW_RELIC_KAFKA_CONTAINER_NAME} | ||
environment: | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://${NEW_RELIC_KAFKA_CONTAINER_NAME}:29092,PLAINTEXT_HOST://${NEW_RELIC_KAFKA_CONTAINER_NAME}:9092 | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 | ||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 | ||
KAFKA_PROCESS_ROLES: broker,controller | ||
KAFKA_NODE_ID: 1 | ||
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@${NEW_RELIC_KAFKA_CONTAINER_NAME}:29093 | ||
KAFKA_LISTENERS: PLAINTEXT://${NEW_RELIC_KAFKA_CONTAINER_NAME}:29092,CONTROLLER://${NEW_RELIC_KAFKA_CONTAINER_NAME}:29093,PLAINTEXT_HOST://:9092 | ||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT | ||
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER | ||
KAFKA_LOG_DIRS: /tmp/kraft-combined-logs | ||
CLUSTER_ID: MkU3OEVBNTcwNTJENDM2Qk | ||
|
||
|
||
networks: | ||
default: | ||
name: kafka-test-network | ||
driver: bridge | ||
driver_opts: | ||
com.docker.network.bridge.enable_icc: "true" |
45 changes: 45 additions & 0 deletions
45
tests/Agent/IntegrationTests/ContainerApplications/docker-compose-smoketestapp.yml
This file contains 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,45 @@ | ||
version: "3" | ||
|
||
# The following must be set either in environment variables or via a .env file in the same folder as this file: | ||
# | ||
# AGENT_PATH host path to the Agent linux home folder - will map to /usr/local/newrelic-dotnet-agent in the container | ||
# LOG_PATH host path for Agent logfile output - will map to /app/logs in the container | ||
# DISTRO_TAG distro tag for build, not including the architecture suffix - possible values 7.0-bullseye-slim, 7.0-alpine, 7.0-jammy | ||
# TARGET_ARCH the target architecture for the build and run -- either amd64 or arm64 | ||
# PORT external port for the smoketest API | ||
# CONTAINER_NAME The name for the container | ||
# PLATFORM The platform that the service runs on -- linux/amd64 or linux/arm64/v8 | ||
# DOTNET_VERSION The dotnet version number to use (7.0, 8.0, etc) | ||
# NETWORK_NAME The network name to use for containers in this app. Should be unique among all running instances. | ||
# TEST_DOCKERFILE The path and dockerfile to use for the service. | ||
# | ||
# and the usual suspects: | ||
# NEW_RELIC_LICENSE_KEY | ||
# NEW_RELIC_HOST | ||
# NEW_RELIC_APP_NAME | ||
# | ||
# | ||
# To build and run, execute `docker compose -f <path to docker-compose.yml> up` | ||
# Alternatively, set COMPOSE_FILE environment variable to the path and omit the -f parameter | ||
|
||
services: | ||
smoketestapp: | ||
container_name: ${CONTAINER_NAME} | ||
image: ${CONTAINER_NAME} | ||
platform: ${PLATFORM} | ||
build: | ||
context: . | ||
dockerfile: ${TEST_DOCKERFILE} | ||
args: | ||
DISTRO_TAG: ${DISTRO_TAG} | ||
TARGET_ARCH: ${TARGET_ARCH} | ||
NEW_RELIC_LICENSE_KEY: ${NEW_RELIC_LICENSE_KEY} | ||
NEW_RELIC_APP_NAME: ${NEW_RELIC_APP_NAME} | ||
NEW_RELIC_HOST: ${NEW_RELIC_HOST} | ||
DOTNET_VERSION: ${DOTNET_VERSION} | ||
APP_DOTNET_VERSION: ${APP_DOTNET_VERSION} | ||
ports: | ||
- "${PORT}:80" | ||
volumes: | ||
- ${AGENT_PATH}:/usr/local/newrelic-dotnet-agent # AGENT_PATH from .env, points to newrelichome_linux_x64 | ||
- ${LOG_PATH}:/app/logs # LOG_PATH from .env, should be a folder unique to this run of the smoketest app |
This file contains 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 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 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 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 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