Add tests for AI21, cohere, huggingfacehub, added logging/metric tags #15018
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Library Injection" | |
on: | |
# Build each branch for testing | |
push: | |
jobs: | |
build-and-publish-test-image: | |
uses: ./.github/workflows/lib-inject-publish.yml | |
secrets: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
ddtrace-version: v1.10 | |
image-tag: ${{ github.sha }} | |
test: | |
needs: | |
- build-and-publish-test-image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
lib-injection-connection: ['network','uds'] | |
lib-injection-use-admission-controller: ['', 'use-admission-controller'] | |
weblog-variant: ['dd-lib-python-init-test-django','dd-lib-python-init-test-django-gunicorn','dd-lib-python-init-test-django-uvicorn'] | |
fail-fast: false | |
env: | |
TEST_LIBRARY: python | |
WEBLOG_VARIANT: ${{ matrix.weblog-variant }} | |
LIBRARY_INJECTION_CONNECTION: ${{ matrix.lib-injection-connection }} | |
LIBRARY_INJECTION_ADMISSION_CONTROLLER: ${{ matrix.lib-injection-use-admission-controller }} | |
DOCKER_REGISTRY_IMAGES_PATH: ghcr.io/datadog | |
DOCKER_IMAGE_TAG: ${{ github.sha }} | |
BUILDX_PLATFORMS: linux/amd64 | |
steps: | |
- name: lib-injection test runner | |
id: lib-injection-test-runner | |
uses: DataDog/system-tests/lib-injection/runner@b3ca75b6ce109a349f7390a9f111e6b3ef3c97ef | |
with: | |
docker-registry: ghcr.io | |
docker-registry-username: ${{ github.repository_owner }} | |
docker-registry-password: ${{ secrets.GITHUB_TOKEN }} | |
test-script: ./lib-injection/run-manual-lib-injection.sh | |
test_unit: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
variant: [ | |
'dd-lib-python-init-test-django', | |
'dd-lib-python-init-test-django-gunicorn', | |
'dd-lib-python-init-test-django-uvicorn', | |
] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Create a docker network for the app and test agent | |
run: | | |
docker network create test-inject | |
- name: Run the test agent | |
run: | | |
docker run \ | |
-d \ | |
--name=testagent \ | |
--network=test-inject \ | |
-p 8126:8126 \ | |
ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.7.2 | |
- name: Prepare the volume | |
run: | | |
cd lib-injection | |
mkdir -p lib-injection/ddtrace_pkgs | |
cp sitecustomize.py lib-injection/ | |
./dl_wheels.py \ | |
--ddtrace-version=v1.10 \ | |
--python-version=3.11 \ | |
--python-version=3.10 \ | |
--python-version=3.9 \ | |
--python-version=3.8 \ | |
--python-version=3.7 \ | |
--arch x86_64 \ | |
--platform manylinux2014 \ | |
--output-dir ddtrace_pkgs \ | |
--verbose | |
- name: Build test app | |
run: | | |
docker build \ | |
-t ${{ matrix.variant }} \ | |
tests/lib-injection/${{ matrix.variant }}/ | |
- name: Run the app | |
run: | | |
docker run -d \ | |
--name ${{ matrix.variant }} \ | |
--network test-inject \ | |
-p 18080:18080 \ | |
-e PYTHONPATH=/lib-injection \ | |
-e DD_TRACE_AGENT_URL=http://testagent:8126 \ | |
-v $PWD/lib-injection:/lib-injection \ | |
${{matrix.variant}} | |
# Wait for the app to start | |
sleep 20 | |
docker logs ${{matrix.variant}} | |
- name: Test the app | |
run: | | |
curl http://localhost:18080 | |
sleep 1 # wait for traces to be sent | |
- name: Print traces | |
run: curl http://localhost:8126/test/traces | |
- name: Check test agent received a trace | |
run: | | |
N=$(curl http://localhost:8126/test/traces | jq -r -e 'length') | |
[[ $N == "1" ]] |