From 0bb7bbdb81605a6e19ae730f129c8a65bc2bc762 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Fri, 14 Jul 2023 09:56:40 -0500 Subject: [PATCH 1/6] add env vars for datadog ci visibility --- .github/workflows/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5f21e5f7047..fa18b28a85a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,6 +33,13 @@ defaults: run: shell: bash +env: + DD_CIVISIBILITY_AGENTLESS_ENABLED: true + DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} + DD_SITE: datadoghq.com + DD_ENV: ci + DD_SERVICE: dbt-core + jobs: code-quality: name: code-quality From 0b995c736ce021001ebc13938895fd2a8903f530 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Fri, 14 Jul 2023 10:39:52 -0500 Subject: [PATCH 2/6] modify pytest command for tracing --- .github/workflows/main.yml | 2 +- dev-requirements.txt | 1 + tox.ini | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fa18b28a85a..a9af2a535d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -168,7 +168,7 @@ jobs: tox --version - name: Run tests - run: tox + run: tox --ddtrace - name: Get current date if: always() diff --git a/dev-requirements.txt b/dev-requirements.txt index e4b51c03081..a6dcd63dc35 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,6 @@ black==23.3.0 bumpversion +ddtrace docutils flake8 flaky diff --git a/tox.ini b/tox.ini index 4a1a63634ca..b313673137b 100644 --- a/tox.ini +++ b/tox.ini @@ -23,6 +23,8 @@ passenv = DBT_* POSTGRES_TEST_* PYTEST_ADDOPTS + DD_SERVICE + DD_ENV commands = {envpython} -m pytest --cov=core {posargs} tests/functional -k "not tests/functional/graph_selection" {envpython} -m pytest --cov=core {posargs} tests/functional/graph_selection From bed7a50e4b06af5e37f2ffc14e07ae2f279bcfb8 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Fri, 14 Jul 2023 11:06:02 -0500 Subject: [PATCH 3/6] fix posargs --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9af2a535d0..610b2412e9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -168,7 +168,7 @@ jobs: tox --version - name: Run tests - run: tox --ddtrace + run: tox -- --ddtrace - name: Get current date if: always() From 6e6f06bc3accd7777be1c70b6092d413a7247ce8 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Fri, 14 Jul 2023 13:39:41 -0500 Subject: [PATCH 4/6] move env vars to job that needs them --- .github/workflows/main.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 610b2412e9b..7dd064acde8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,13 +33,6 @@ defaults: run: shell: bash -env: - DD_CIVISIBILITY_AGENTLESS_ENABLED: true - DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} - DD_SITE: datadoghq.com - DD_ENV: ci - DD_SERVICE: dbt-core - jobs: code-quality: name: code-quality @@ -138,6 +131,11 @@ jobs: DBT_TEST_USER_1: dbt_test_user_1 DBT_TEST_USER_2: dbt_test_user_2 DBT_TEST_USER_3: dbt_test_user_3 + DD_CIVISIBILITY_AGENTLESS_ENABLED: true + DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} + DD_SITE: datadoghq.com + DD_ENV: ci + DD_SERVICE: ${{ github.event.repository.name }} steps: - name: Check out the repository From fcd2c50e8827796e9dbdf54de6a0b49c24542cd8 Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Fri, 14 Jul 2023 16:50:12 -0500 Subject: [PATCH 5/6] add test repeater to DD --- .github/workflows/test-repeater.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-repeater.yml b/.github/workflows/test-repeater.yml index 27fbe4729ff..4c17572b7b3 100644 --- a/.github/workflows/test-repeater.yml +++ b/.github/workflows/test-repeater.yml @@ -75,6 +75,11 @@ jobs: DBT_TEST_USER_1: dbt_test_user_1 DBT_TEST_USER_2: dbt_test_user_2 DBT_TEST_USER_3: dbt_test_user_3 + DD_CIVISIBILITY_AGENTLESS_ENABLED: true + DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} + DD_SITE: datadoghq.com + DD_ENV: ci + DD_SERVICE: ${{ github.event.repository.name }} steps: - name: "Checkout code" @@ -116,7 +121,7 @@ jobs: for ((i=1; i<=${{ inputs.num_runs_per_batch }}; i++)) do echo "Running pytest iteration $i..." - python -m pytest ${{ inputs.test_path }} + python -m pytest ${{ inputs.test_path }} --ddtrace exit_code=$? if [[ $exit_code -eq 0 ]]; then From b4911ccd4765413d8e947082ffbd0efd0731829b Mon Sep 17 00:00:00 2001 From: Emily Rockman Date: Fri, 14 Jul 2023 17:04:16 -0500 Subject: [PATCH 6/6] swap flags --- .github/workflows/test-repeater.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-repeater.yml b/.github/workflows/test-repeater.yml index 4c17572b7b3..e414792140c 100644 --- a/.github/workflows/test-repeater.yml +++ b/.github/workflows/test-repeater.yml @@ -121,7 +121,7 @@ jobs: for ((i=1; i<=${{ inputs.num_runs_per_batch }}; i++)) do echo "Running pytest iteration $i..." - python -m pytest ${{ inputs.test_path }} --ddtrace + python -m pytest --ddtrace ${{ inputs.test_path }} exit_code=$? if [[ $exit_code -eq 0 ]]; then