File tree Expand file tree Collapse file tree 7 files changed +8
-0
lines changed Expand file tree Collapse file tree 7 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ test: build-initcontainer build-testapp check-language-arg
76
76
helm install test-deployment ${REPO_ROOT} /tests/${INITCONTAINER_LANGUAGE} /chart/
77
77
sleep 3
78
78
kubectl wait --for=condition=Ready -n default --all pods
79
+ # If jq is installed, check for the initcontainer to be visible on the pod spec
80
+ command -v jq && kubectl get pods --output json | jq '.items[].spec.initContainers | select( . != null )[].name' | grep -q "newrelic-instrumentation-" || $$(echo "Operator failed to attach initcontainer." >&2; exit 1)
79
81
minikube service test-app-${INITCONTAINER_LANGUAGE}-service -n default
80
82
81
83
# View test app container logs
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ scenarios:
6
6
- helm install test-dotnet ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default
7
7
- sleep 5
8
8
- kubectl wait --for=condition=Ready -n default --all pods
9
+ - kubectl get pods --output json | jq '.items[].spec.initContainers | select( . != null )[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1)
9
10
- sleep 15 # give the agent time to connect
10
11
- curl --fail-with-body $(minikube service test-app-dotnet-service --url -n default)/WeatherForecast
11
12
tests :
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ scenarios:
6
6
- helm install test-java ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default
7
7
- sleep 120
8
8
- kubectl wait --for=condition=Ready -n default --all pods
9
+ - kubectl get pods --output json | jq '.items[].spec.initContainers | select( . != null )[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1)
9
10
- curl --fail-with-body $(minikube service test-app-java-service --url -n default)
10
11
tests :
11
12
nrqls :
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ scenarios:
6
6
- helm install test-nodejs ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default
7
7
- sleep 5
8
8
- kubectl wait --for=condition=Ready -n default --all pods
9
+ - kubectl get pods --output json | jq '.items[].spec.initContainers | select( . != null )[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1)
9
10
- curl --fail-with-body $(minikube service test-app-nodejs-service --url -n default)
10
11
tests :
11
12
nrqls :
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ scenarios:
6
6
- helm install test-php ./chart/ --set=scenarioTag="${SCENARIO_TAG}" ${TEST_APP_HELM_CHART_ARGS} -n default
7
7
- sleep 5
8
8
- kubectl wait --for=condition=Ready -n default --all pods --timeout=2m
9
+ - kubectl get pods --output json | jq '.items[].spec.initContainers | select( . != null )[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1)
9
10
- curl --fail-with-body $(minikube service test-app-php-service --url -n default)
10
11
- sleep 5
11
12
- curl --fail-with-body $(minikube service test-app-php-service --url -n default)
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ scenarios:
6
6
- helm install test-python ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default
7
7
- sleep 5
8
8
- kubectl wait --for=condition=Ready -n default --all pods --timeout=2m
9
+ - kubectl get pods --output json | jq '.items[].spec.initContainers | select( . != null )[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1)
9
10
- curl --fail-with-body $(minikube service test-app-python-service --url -n default)
10
11
tests :
11
12
nrqls :
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ scenarios:
6
6
- helm install test-ruby ./chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default
7
7
- sleep 5
8
8
- kubectl wait --for=condition=Ready -n default --all pods
9
+ - kubectl get pods --output json | jq '.items[].spec.initContainers | select( . != null )[].name' | grep -q "newrelic-instrumentation-" || $(echo "Operator failed to attach initcontainer." >&2; exit 1)
9
10
- curl --fail-with-body $(minikube service test-app-ruby-service --url -n default)/
10
11
tests :
11
12
nrqls :
You can’t perform that action at this time.
0 commit comments