diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index e042179..b2fe44c 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -109,18 +109,18 @@ jobs: minikube image load e2e/python-test-app:e2e # Add the custom resource file (points to the agent init container) and test application container to the cluster. - - name: Deploy test app to minikube - run: | - kubectl create namespace python-test - kubectl apply -f tests/python/customresource.yaml -n python-test - kubectl apply -f tests/python/python_test_app_deployment.yaml -n python-test - sleep 1 - kubectl wait --for=condition=Ready --namespace python-test --all pods + # - name: Deploy test app to minikube + # run: | + # kubectl create namespace python-test + # kubectl apply -f tests/python/customresource.yaml -n python-test + # kubectl apply -f tests/python/python_test_app_deployment.yaml -n python-test + # sleep 1 + # kubectl wait --for=condition=Ready --namespace python-test --all pods - # Wait 30 seconds for the cluster to start and then hit the test application endpoint. - - name: Test - run: | - curl --fail-with-body $(minikube service python-test-app-service --url -n python-test) + # # Wait 30 seconds for the cluster to start and then hit the test application endpoint. + # - name: Test + # run: | + # curl --fail-with-body $(minikube service python-test-app-service --url -n python-test) - name: Run e2e-test uses: newrelic/newrelic-integration-e2e-action@a97ced80a4841c8c6261d1f9dca6706b1d89acb1 # 1.11.0 @@ -128,7 +128,7 @@ jobs: retry_seconds: 60 retry_attempts: 5 agent_enabled: false - spec_path: e2e/test-specs.yml + spec_path: tests/test-specs.yml account_id: ${{ secrets.K8S_AGENTS_E2E_ACCOUNT_ID }} api_key: ${{ secrets.K8S_AGENTS_E2E_API_KEY }} license_key: ${{ secrets.K8S_AGENTS_E2E_LICENSE_KEY }} diff --git a/tests/python/python_test_app_deployment.yaml b/tests/python/python_test_app_deployment.yaml index 4fe57e8..01355ab 100644 --- a/tests/python/python_test_app_deployment.yaml +++ b/tests/python/python_test_app_deployment.yaml @@ -21,6 +21,9 @@ spec: imagePullPolicy: Never ports: - containerPort: 8000 + env: + - name: NEW_RELIC_APP_NAME + value: "k8s-e2e-test-app-${SCENARIO_TAG:-0}" --- apiVersion: v1 kind: Service diff --git a/tests/python/test-specs.yml b/tests/python/test-specs.yml new file mode 100644 index 0000000..b9fd0fc --- /dev/null +++ b/tests/python/test-specs.yml @@ -0,0 +1,23 @@ +description: | + End-to-end tests for python initcontainer + +scenarios: + - description: | + This scenario will verify that transactions are reported by the + before: + - kubectl create namespace nr-${SCENARIO_TAG} + - kubectl apply -f tests/python/customresource.yaml -n nr-${SCENARIO_TAG} + - kubectl apply -f tests/python/python_test_app_deployment.yaml -n nr-${SCENARIO_TAG} + - sleep 10 + - kubectl wait --for=condition=Ready --namespace nr-${SCENARIO_TAG} --all pods + - curl --fail-with-body $(minikube service python-test-app-service --url -n nr-${SCENARIO_TAG}) + after: + - kubectl delete -f tests/python/customresource.yaml -n nr-${SCENARIO_TAG} + - kubectl delete -f tests/python/python_test_app_deployment.yaml -n nr-${SCENARIO_TAG} + tests: + nrqls: + - query: FROM Metric SELECT latest(something) AS 'start_time' WHERE metricName = 'k8s.persistentvolume.createdAt' AND appName = 'k8s-e2e-test-app-${SCENARIO_TAG:-0}' + expected_results: + - key: "start_time" + lowerBoundedValue: 0.0 + entities: []