From 9720df14d4cd589c24d3708b1b528f064b181d13 Mon Sep 17 00:00:00 2001 From: Tim Pansino Date: Thu, 16 May 2024 15:17:35 -0700 Subject: [PATCH] Moving e2e test key --- tests/python/chart/templates/deployment.yaml | 4 ++-- tests/python/main.py | 5 +---- tests/python/test-specs.yml | 5 ++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/python/chart/templates/deployment.yaml b/tests/python/chart/templates/deployment.yaml index de62247..250234a 100644 --- a/tests/python/chart/templates/deployment.yaml +++ b/tests/python/chart/templates/deployment.yaml @@ -24,8 +24,8 @@ spec: env: - name: NEW_RELIC_APP_NAME value: k8s-e2e-test-app-python - - name: SCENARIO_TAG - value: {{ quote .Values.scenarioTag }} + - name: NEW_RELIC_LABELS + value: "testKey:{{ .Values.scenarioTag | default "NOTSET" }}" --- apiVersion: v1 kind: Service diff --git a/tests/python/main.py b/tests/python/main.py index 9b84f57..b1def4a 100644 --- a/tests/python/main.py +++ b/tests/python/main.py @@ -1,4 +1,3 @@ -import os import sys import traceback @@ -10,10 +9,8 @@ @app.route("/") def hello_world(): try: - from newrelic.agent import current_transaction, add_custom_attribute - + from newrelic.agent import current_transaction assert current_transaction(), "No active transaction." - add_custom_attribute("testKey", os.getenv("SCENARIO_TAG", "NOTSET")) except Exception: return "".join(traceback.format_exception(*sys.exc_info())), 417 diff --git a/tests/python/test-specs.yml b/tests/python/test-specs.yml index 1227129..9269ccd 100644 --- a/tests/python/test-specs.yml +++ b/tests/python/test-specs.yml @@ -1,6 +1,5 @@ -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 before: