Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion test/system-test-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@

KAFKA_CONTAINER_NAME = "sentry-java-system-test-kafka"
KAFKA_BOOTSTRAP_SERVERS = "localhost:9092"
KAFKA_BROKER_REQUIRED_MODULES = {
"sentry-samples-console",
"sentry-samples-spring-boot-jakarta",
}
KAFKA_PROFILE_REQUIRED_MODULES = {
"sentry-samples-spring-boot-jakarta",
}

class ServerType(Enum):
TOMCAT = 0
Expand Down Expand Up @@ -202,7 +209,10 @@ def kill_process(self, pid: int, name: str) -> None:
print(f"Process {pid} was already dead")

def module_requires_kafka(self, sample_module: str) -> bool:
return sample_module == "sentry-samples-console"
return sample_module in KAFKA_BROKER_REQUIRED_MODULES

def module_requires_kafka_profile(self, sample_module: str) -> bool:
return sample_module in KAFKA_PROFILE_REQUIRED_MODULES

def wait_for_port(self, host: str, port: int, max_attempts: int = 20) -> bool:
for _ in range(max_attempts):
Expand Down Expand Up @@ -423,6 +433,12 @@ def start_spring_server(self, sample_module: str, java_agent: str, java_agent_au
env.update(SENTRY_ENVIRONMENT_VARIABLES)
env["SENTRY_AUTO_INIT"] = java_agent_auto_init

if self.module_requires_kafka_profile(sample_module):
env["SPRING_PROFILES_ACTIVE"] = "kafka"
print("Enabling Spring profile: kafka")
else:
env.pop("SPRING_PROFILES_ACTIVE", None)

# Build command
jar_path = f"sentry-samples/{sample_module}/build/libs/{sample_module}-0.0.1-SNAPSHOT.jar"
cmd = ["java"]
Expand Down
Loading