Skip to content

Commit

Permalink
Add an integration test for APM injection (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slavek Kabrda authored Jan 23, 2024
1 parent 37168d5 commit 20d3f89
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,29 @@ jobs:
python: "<<parameters.python>>"
jinja2_native: "<<parameters.jinja2_native>>"

test_apm_injection:
parameters:
ansible_version:
type: string

machine:
image: ubuntu-2204:2023.10.1 # includes docker and docker-compose

steps:
- checkout
# these repos have expired GPG keys and make APT fail (and we don't need them)
- run: sudo rm /etc/apt/sources.list.d/*
- run: pip3 install ansible==<<parameters.ansible_version>>
- run: ansible-playbook --become -i ./ci_test/inventory/ci.ini "./ci_test/install_agent_7_apm_python.yaml"
- run: sudo datadog-agent status || true
- run: ps aux | grep -v grep | grep datadog-agent
- run: git -C /tmp clone https://github.com/DataDog/system-tests.git
- run: cd /tmp/system-tests/lib-injection/build/docker/python/dd-lib-python-init-test-django && sudo docker build -t system-tests/local .
- run: cd /tmp/system-tests/tests/onboarding/weblog/python/test-app-python-django && sudo docker-compose up --detach
- run: curl localhost:5985
# verify that the emitted trace is in trace-agent log
- run: timeout 70 grep -m 1 "lang:python" <(tail -F /var/log/datadog/trace-agent.log)

workflows:
version: 2
test_datadog_role:
Expand Down Expand Up @@ -295,3 +318,8 @@ workflows:
ansible_version: ["2.8", "2.9", "2.10", "3.4", "4.10"]
agent_version: ["6_macos", "7_macos"]
python: ["python3"]

- test_apm_injection:
matrix:
parameters:
ansible_version: ["6.7.0"]
10 changes: 10 additions & 0 deletions ci_test/install_agent_7_apm_python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---

- hosts: all
roles:
- { role: "/home/circleci/project/" }
vars:
datadog_api_key: "11111111111111111111111111111111"
datadog_agent_major_version: 7
datadog_apm_instrumentation_enabled: "all"
datadog_apm_instrumentation_languages: ["python"]

0 comments on commit 20d3f89

Please sign in to comment.