{{- if and $.Values.testServer.enabled (not $.Values.deployment.disableDeployments) }}

# OneUptime test-server Deployment
{{- $testServerPorts := $.Values.testServer.ports -}}
{{- $testServerEnv := dict "PORT"  $.Values.testServer.ports.http  "DISABLE_TELEMETRY" $.Values.testServer.disableTelemetryCollection  "ENABLE_PROFILING" $.Values.testServer.enableProfiling -}}
{{- $testServerDeploymentArgs :=dict "IsUI" true "ServiceName" "test-server" "Ports" $testServerPorts "Release" $.Release "Values" $.Values "Env" $testServerEnv "Resources" $.Values.testServer.resources "NodeSelector" $.Values.testServer.nodeSelector "PodSecurityContext" $.Values.testServer.podSecurityContext "ContainerSecurityContext" $.Values.testServer.containerSecurityContext "DisableAutoscaler" $.Values.testServer.disableAutoscaler "ReplicaCount" $.Values.testServer.replicaCount -}}
{{- include "oneuptime.deployment" $testServerDeploymentArgs }}
---

# OneUptime testServer autoscaler
{{- $testServerAutoScalerArgs := dict "ServiceName" "test-server" "Release" $.Release "Values" $.Values "DisableAutoscaler" $.Values.testServer.disableAutoscaler -}}
{{- include "oneuptime.autoscaler" $testServerAutoScalerArgs }}
---

{{- end }}

# OneUptime test-server Service
{{- $testServerPorts := $.Values.testServer.ports -}}
{{- $testServerServiceArgs := dict "ServiceName" "test-server" "Ports" $testServerPorts "Release" $.Release "Values" $.Values -}}
{{- include "oneuptime.service" $testServerServiceArgs }}
---