Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed May 10, 2024
1 parent e1cee93 commit 3b6935a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ RUN pip install flask==3.0.3 gunicorn==22.0.0

COPY main.py .

CMD ["gunicorn", "main:app", "-b", "0.0.0.0:8000"]
CMD ["gunicorn", "main:app", "-b", "0.0.0.0:8000", "--workers=1"]
2 changes: 2 additions & 0 deletions tests/python/customresource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ spec:
value: "30"

# TODO: Remove these hacks
- name: NEW_RELIC_STARTUP_DEBUG
value: "true"
- name: NEW_RELIC_K8S_OPERATOR_ENABLED
value: "true"
8 changes: 4 additions & 4 deletions tests/python/test-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ scenarios:
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}
- kubectl apply -f ./customresource.yaml -n nr-${SCENARIO_TAG}
- kubectl apply -f ./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}
- kubectl delete -f ./customresource.yaml -n nr-${SCENARIO_TAG}
- kubectl delete -f ./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}'
Expand Down

0 comments on commit 3b6935a

Please sign in to comment.