From 74224972a6ca6dc01c7b798942c3fc6f70dea57d Mon Sep 17 00:00:00 2001 From: Tim Pansino Date: Mon, 27 Jan 2025 16:50:22 -0800 Subject: [PATCH] Update test app deployments for all agents --- tests/dotnet/test-specs.yml | 16 ++++++++++++---- tests/java/test-specs.yml | 13 ++++++++++--- tests/nodejs/test-specs.yml | 11 +++++++++-- tests/php/test-specs.yml | 13 ++++++++++--- tests/python/test-specs.yml | 4 ++-- tests/ruby/test-specs.yml | 13 ++++++++++--- 6 files changed, 53 insertions(+), 17 deletions(-) diff --git a/tests/dotnet/test-specs.yml b/tests/dotnet/test-specs.yml index 83900cc..2ab2fc5 100644 --- a/tests/dotnet/test-specs.yml +++ b/tests/dotnet/test-specs.yml @@ -1,13 +1,21 @@ -description: End-to-end tests for dotnet initcontainer +description: End-to-end tests for .NET initcontainer custom_test_key: tags.testKey scenarios: - description: This scenario will verify that a transaction is reported by the test app after a curl request before: + # Deploy test app chart - helm install test-dotnet ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default - sleep 5 - - kubectl wait --for=condition=Ready -n default --all pods -# - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1) - - sleep 15 # give the agent time to connect + # Recreate test app pod to ensure instrumentation resource is used + - kubectl delete pods -l "app=test-app-dotnet" + # Wait for pods to pass healthchecks + - sleep 5 + - kubectl wait --for=condition=Ready -n default --all pods --timeout=2m + # Ensure initcontainer was attached by operator + - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || { echo -e "===== Operator failed to attach initcontainer. =====" >&2; exit 1; } + # Give the agent time to connect + - sleep 15 + # Send traffic to test app to generate transactions - curl --fail-with-body $(minikube service test-app-dotnet-service --url -n default)/WeatherForecast tests: nrqls: diff --git a/tests/java/test-specs.yml b/tests/java/test-specs.yml index 08fc7c2..d008cd6 100644 --- a/tests/java/test-specs.yml +++ b/tests/java/test-specs.yml @@ -1,12 +1,19 @@ -description: End-to-end tests for java initcontainer +description: End-to-end tests for Java initcontainer custom_test_key: tags.testKey scenarios: - description: This scenario will verify that a transaction is reported by the test app after a curl request before: + # Deploy test app chart - helm install test-java ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default + - sleep 5 + # Recreate test app pod to ensure instrumentation resource is used + - kubectl delete pods -l "app=test-app-java" + # Wait for pods to pass healthchecks - sleep 120 - - kubectl wait --for=condition=Ready -n default --all pods -# - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1) + - kubectl wait --for=condition=Ready -n default --all pods --timeout=2m + # Ensure initcontainer was attached by operator + - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || { echo -e "===== Operator failed to attach initcontainer. =====" >&2; exit 1; } + # Send traffic to test app to generate transactions - curl --fail-with-body $(minikube service test-app-java-service --url -n default) tests: nrqls: diff --git a/tests/nodejs/test-specs.yml b/tests/nodejs/test-specs.yml index d05e6b1..edd8370 100644 --- a/tests/nodejs/test-specs.yml +++ b/tests/nodejs/test-specs.yml @@ -3,10 +3,17 @@ custom_test_key: tags.testKey scenarios: - description: This scenario will verify that a transaction is reported by the test app after a curl request before: + # Deploy test app chart - helm install test-nodejs ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default - sleep 5 - - kubectl wait --for=condition=Ready -n default --all pods -# - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1) + # Recreate test app pod to ensure instrumentation resource is used + - kubectl delete pods -l "app=test-app-nodejs" + # Wait for pods to pass healthchecks + - sleep 5 + - kubectl wait --for=condition=Ready -n default --all pods --timeout=2m + # Ensure initcontainer was attached by operator + - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || { echo -e "===== Operator failed to attach initcontainer. =====" >&2; exit 1; } + # Send traffic to test app to generate transactions - curl --fail-with-body $(minikube service test-app-nodejs-service --url -n default) tests: nrqls: diff --git a/tests/php/test-specs.yml b/tests/php/test-specs.yml index a29e213..94b7da3 100644 --- a/tests/php/test-specs.yml +++ b/tests/php/test-specs.yml @@ -1,12 +1,19 @@ -description: End-to-end tests for php initcontainer +description: End-to-end tests for PHP initcontainer custom_test_key: tags.testKey scenarios: - description: This scenario will verify that a transaction is reported by the test app after a curl request before: - - helm install test-php ./chart/ --set=scenarioTag="${SCENARIO_TAG}" ${TEST_APP_HELM_CHART_ARGS} -n default + # Deploy test app chart + - helm install test-php ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default + - sleep 5 + # Recreate test app pod to ensure instrumentation resource is used + - kubectl delete pods -l "app=test-app-php" + # Wait for pods to pass healthchecks - sleep 5 - kubectl wait --for=condition=Ready -n default --all pods --timeout=2m -# - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1) + # Ensure initcontainer was attached by operator + - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || { echo -e "===== Operator failed to attach initcontainer. =====" >&2; exit 1; } + # Send traffic to test app to generate transactions - curl --fail-with-body $(minikube service test-app-php-service --url -n default) - sleep 5 - curl --fail-with-body $(minikube service test-app-php-service --url -n default) diff --git a/tests/python/test-specs.yml b/tests/python/test-specs.yml index 287efc1..798b21a 100644 --- a/tests/python/test-specs.yml +++ b/tests/python/test-specs.yml @@ -1,4 +1,4 @@ -description: End-to-end tests for python initcontainer +description: End-to-end tests for Python initcontainer custom_test_key: tags.testKey scenarios: - description: This scenario will verify that a transaction is reported by the test app after a curl request @@ -8,8 +8,8 @@ scenarios: - sleep 5 # Recreate test app pod to ensure instrumentation resource is used - kubectl delete pods -l "app=test-app-python" - - sleep 5 # Wait for pods to pass healthchecks + - sleep 5 - kubectl wait --for=condition=Ready -n default --all pods --timeout=2m # Ensure initcontainer was attached by operator - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || { echo -e "===== Operator failed to attach initcontainer. =====" >&2; exit 1; } diff --git a/tests/ruby/test-specs.yml b/tests/ruby/test-specs.yml index 1c4090f..87a972b 100644 --- a/tests/ruby/test-specs.yml +++ b/tests/ruby/test-specs.yml @@ -1,12 +1,19 @@ -description: End-to-end tests for ruby initcontainer +description: End-to-end tests for Ruby initcontainer custom_test_key: tags.testKey scenarios: - description: This scenario will verify that a transaction is reported by the test app after a curl request before: + # Deploy test app chart - helm install test-ruby ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default - sleep 5 - - kubectl wait --for=condition=Ready -n default --all pods -# - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1) + # Recreate test app pod to ensure instrumentation resource is used + - kubectl delete pods -l "app=test-app-ruby" + # Wait for pods to pass healthchecks + - sleep 5 + - kubectl wait --for=condition=Ready -n default --all pods --timeout=2m + # Ensure initcontainer was attached by operator + - kubectl get pods --output yaml | yq '.items[].spec.initContainers[].name' | grep -q "newrelic-instrumentation-" || { echo -e "===== Operator failed to attach initcontainer. =====" >&2; exit 1; } + # Send traffic to test app to generate transactions - curl --fail-with-body $(minikube service test-app-ruby-service --url -n default)/ tests: nrqls: