Skip to content

Commit

Permalink
Update test app deployments for all agents
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Jan 28, 2025
1 parent 5409c89 commit 7422497
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 17 deletions.
16 changes: 12 additions & 4 deletions tests/dotnet/test-specs.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
13 changes: 10 additions & 3 deletions tests/java/test-specs.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
11 changes: 9 additions & 2 deletions tests/nodejs/test-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 10 additions & 3 deletions tests/php/test-specs.yml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/python/test-specs.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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; }
Expand Down
13 changes: 10 additions & 3 deletions tests/ruby/test-specs.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 7422497

Please sign in to comment.