Skip to content

Commit

Permalink
Move deployment to helm
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed May 14, 2024
1 parent b43951e commit 73be936
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 13 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,6 @@ jobs:
run: |
minikube image build -t e2e/test-app-${{ env.INITCONTAINER_LANGUAGE }}:e2e tests/${{ env.INITCONTAINER_LANGUAGE }}/
- name: Deploy test app to minikube
run: |
kubectl apply -f tests/${{ env.INITCONTAINER_LANGUAGE }}/customresource.yaml -n default
kubectl apply -f tests/${{ env.INITCONTAINER_LANGUAGE }}/test_app_deployment.yaml -n default
sleep 5
kubectl wait --for=condition=Ready -n default --all pods
- name: Test
run: |
curl --fail-with-body $(minikube service test-app-${{ env.INITCONTAINER_LANGUAGE }}-service --url -n default)
- name: Run e2e-test
uses: newrelic/newrelic-integration-e2e-action@a97ced80a4841c8c6261d1f9dca6706b1d89acb1 # 1.11.0
with:
Expand Down
23 changes: 23 additions & 0 deletions tests/python/chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions tests/python/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: test-app-python
description: A Helm chart for Kubernetes
type: application
version: 1.0.0
appVersion: "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ spec:
env:
- name: NEW_RELIC_APP_NAME
value: k8s-e2e-test-app-python
- name: SCENARIO_TAG
value: {{ quote .Values.scenarioTag }}
---
apiVersion: v1
kind: Service
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions tests/python/chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scenarioTag: ""
7 changes: 5 additions & 2 deletions tests/python/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import sys
import traceback

Expand All @@ -9,9 +10,11 @@
@app.route("/")
def hello_world():
try:
from newrelic.agent import current_transaction
from newrelic.agent import current_transaction, add_custom_attribute

assert current_transaction(), "No active transaction."
add_custom_attribute("testKey", os.getenv("NEW_RELIC_SCENARIO_TAG", "NOTSET"))
except Exception:
return "".join(traceback.format_exception(*sys.exc_info())), 417

return "<p>Hello, World!</p>"
return f"Hello, World!"
3 changes: 3 additions & 0 deletions tests/python/test-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ description: |
scenarios:
- description: This scenario will verify that a transaction is reported by the test app after a curl request
before:
- helm install test-python ./tests/python/chart/ --set=scenarioTag="${SCENARIO_TAG}" -n default
- sleep 5
- kubectl wait --for=condition=Ready -n default --all pods
- curl --fail-with-body $(minikube service test-app-python-service --url -n default)
tests:
nrqls:
Expand Down

0 comments on commit 73be936

Please sign in to comment.