Skip to content

Commit

Permalink
Update python test app
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed Oct 11, 2024
1 parent 6b28dea commit 10fc2d6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUNTIME_VERSION=3.7
ARG RUNTIME_VERSION=3.11
FROM python:$RUNTIME_VERSION

# Install dependencies
Expand Down
4 changes: 1 addition & 3 deletions tests/python/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ spec:
metadata:
labels:
app: test-app-python
app.newrelic.instrumentation: python
annotations:
instrumentation.newrelic.com/inject-python: "true"
app.newrelic.instrumentation: newrelic-python-agent
spec:
containers:
- name: test-app-python
Expand Down
2 changes: 1 addition & 1 deletion tests/python/chart/templates/instrumentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
matchExpressions:
- key: "app.newrelic.instrumentation"
operator: "In"
values: ["python"]
values: ["newrelic-python-agent"]
agent:
language: python
image: e2e/newrelic-python-init:e2e
Expand Down
6 changes: 5 additions & 1 deletion tests/python/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os
import pprint
import sys
import traceback

Expand Down Expand Up @@ -30,4 +32,6 @@ def hello_world():
return "<p>Hello, World!</p><br><p>new_relic_path = %s</p>" % str(new_relic_path)

except Exception:
return "".join(traceback.format_exception(*sys.exc_info())), 417
response = "\n".join(traceback.format_exception(*sys.exc_info()))
response += "\n" + pprint.pformat(dict(os.environ))
return response.replace("\n", "<br>"), 417

0 comments on commit 10fc2d6

Please sign in to comment.