diff --git a/.github/workflows/datadog_test_optimization.yml b/.github/workflows/datadog_test_optimization.yml new file mode 100644 index 00000000..a011c097 --- /dev/null +++ b/.github/workflows/datadog_test_optimization.yml @@ -0,0 +1,56 @@ +name: Datadog Test Optimization + +permissions: + checks: write + contents: read + +on: + schedule: + # every hour, 9-5 eastern, M-F + - cron: '15 12-21 * * 1-5' + + push: + branches: + - 'main' + - 'michael.richey/dd-test-opt' + +env: + DD_API_KEY: ${{ secrets.DD_API_KEY }} + DD_DESTINATION_API_KEY: ${{ secrets.DD_DESTINATION_API_KEY }} + DD_DESTINATION_APP_KEY: ${{ secrets.DD_DESTINATION_APP_KEY }} + DD_DESTINATION_API_URL: ${{ secrets.DD_DESTINATION_API_URL }} + DD_SOURCE_API_KEY: ${{ secrets.DD_SOURCE_API_KEY }} + DD_SOURCE_APP_KEY: ${{ secrets.DD_SOURCE_APP_KEY }} + DD_SOURCE_API_URL: ${{ secrets.DD_SOURCE_API_URL }} + RECORD: false + PYTEST_ADDOPTS: "--ddtrace" + DD_ENV: ci + DD_SERVICE: datadog-sync-cli + DD_TAGS: "team:hamr" + DD_TRACE_ANALYTICS_ENABLED: "true" + +jobs: + test-optimization: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Install Python + uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c + with: + python-version: 3.12 + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Configure Datadog Test Optimization + uses: datadog/test-visibility-github-action@v2 + with: + languages: python + api_key: ${{ secrets.DD_API_KEY }} + site: datadoghq.com + - name: Install requirements + run: | + python -m pip install . + python -m pip install tox + - name: Run unit tests + run: tox -e py312 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f419fb9..085c85c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,11 @@ env: DD_SOURCE_API_KEY: ${{ secrets.DD_SOURCE_API_KEY }} DD_SOURCE_APP_KEY: ${{ secrets.DD_SOURCE_APP_KEY }} DD_SOURCE_API_URL: ${{ secrets.DD_SOURCE_API_URL }} + PYTEST_ADDOPTS: "--ddtrace" + DD_ENV: ci + DD_SERVICE: datadog-sync-cli + DD_TAGS: "team:hamr" + DD_TRACE_ANALYTICS_ENABLED: "true" jobs: test: diff --git a/.github/workflows/test_integrations.yml b/.github/workflows/test_integrations.yml index 2285e772..d2b24d1e 100644 --- a/.github/workflows/test_integrations.yml +++ b/.github/workflows/test_integrations.yml @@ -52,7 +52,7 @@ jobs: DD_AGENT_HOST: localhost DD_ENV: ci DD_SERVICE: datadog-sync-cli - DD_TAGS: "team:integrations-tools-and-libraries" + DD_TAGS: "team:hamr" DD_TRACE_ANALYTICS_ENABLED: "true" RECORD: "none" PYTEST_ADDOPTS: "--ddtrace" diff --git a/scripts/test_requirements.txt b/scripts/test_requirements.txt new file mode 100644 index 00000000..f4996d3d --- /dev/null +++ b/scripts/test_requirements.txt @@ -0,0 +1,18 @@ +boto3==1.35.91 +click==8.1.7 +configobj==5.0.8 +deepdiff==6.7.1 +aiohttp==3.9.5 +tqdm==4.66.2 +certifi>=2022.12.7 +python-dateutil +setuptools>=67.6.0 +setuptools_scm +ddtrace==2.21.1 +black==24.3.0 +pytest==8.1.1 +pytest-black +pytest-console-scripts +pytest-recording +vcrpy@git+https://github.com/skarimo/vcrpy.git +freezegun==1.5.0 diff --git a/setup.cfg b/setup.cfg index 73310927..7084239f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -49,7 +49,7 @@ console_scripts = [options.extras_require] tests = - ddtrace==2.21.1 + ddtrace>=2.21.1 black==24.3.0 pytest==8.1.1 pytest-black