Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- master
pull_request:
branches:
- master
paths:
# List of files/paths that should trigger the run. The intention is to avoid running all tests if the commit only includes changes on assets or README
- '*/datadog_checks/**'
Expand Down
60 changes: 12 additions & 48 deletions .github/workflows/test-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ jobs:
mkdir "${{ env.TRACE_CAPTURE_BASE_DIR }}"
python .ddev/ci/scripts/traces.py capture --port "${{ inputs.trace-agent-port }}" --record-file "${{ env.TRACE_CAPTURE_FILE }}" > "${{ env.TRACE_CAPTURE_LOG }}" 2>&1 &

- name: Verify ddtrace version
if: inputs.repo == 'core' && inputs.latest != true && inputs.minimum-base-package != true
timeout-minutes: 5
run: |-
# Run the ddtrace version check if it exists for this integration
if [ -f "${{ inputs.target }}/tests/conftest.py" ] && grep -q "def test_ddtrace_version" "${{ inputs.target }}/tests/conftest.py"; then
echo "Running ddtrace version verification for ${{ inputs.target }}"
ddev -v test ${{ inputs.target-env && format('{0}:{1}', inputs.target, inputs.target-env) || inputs.target }} -- tests/conftest.py::test_ddtrace_version -s
else
echo "No ddtrace version test found for ${{ inputs.target }}, skipping verification"
fi

- name: Run Unit & Integration tests
if: inputs.latest != true && inputs.minimum-base-package != true
timeout-minutes: ${{ inputs.step-timeout-minutes }}
Expand All @@ -262,54 +274,6 @@ jobs:
ddev -v test --cov --junit ${{ inputs.target-env && format('{0}:{1}', inputs.target, inputs.target-env) || inputs.target }} ${{ inputs.pytest-args != '' && format('-- {0} -k "not fips"', inputs.pytest-args) || '-- -k "not fips"' }}
fi

- name: Run Unit & Integration tests with minimum version of base package
if: inputs.minimum-base-package
timeout-minutes: ${{ inputs.step-timeout-minutes }}
run: |
if [ '${{ inputs.pytest-args }}' = '-m flaky' ]; then
set +e # Disable immediate exit
ddev test --compat --recreate --junit ${{ inputs.target-env && format('{0}:{1}', inputs.target, inputs.target-env) || inputs.target }} -- ${{ inputs.pytest-args }} -k "not fips"
exit_code=$?
if [ $exit_code -eq 5 ]; then
# Flaky test count can be zero, this is done to avoid pipeline failure
echo "No tests were collected."
exit 0
else
exit $exit_code
fi
else
ddev test --compat --recreate --junit ${{ inputs.target-env && format('{0}:{1}', inputs.target, inputs.target-env) || inputs.target }} ${{ inputs.pytest-args != '' && format('-- {0} -k "not fips"', inputs.pytest-args) || '-- -k "not fips"' }}
fi

- name: Run E2E tests with latest base package
if: inputs.repo == 'core' && !inputs.minimum-base-package
timeout-minutes: ${{ inputs.step-timeout-minutes }}
env:
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
run: |
# '-- all' is passed for e2e tests if pytest args are provided
# This is done to avoid ddev from interpreting the arguments as environments
# instead of pytest-args, because by default if no environment is provided
# after -- it will run all environments. So when pytests args are provided
# ddev will interpret '-m' as an environment to run the e2e test on and fails
# This is not required when no pytest args are provided and it will run all environments
# by default
set +e # Disable immediate exit
if [ '${{ inputs.pytest-args }}' = '-m flaky' ] || [ '${{ inputs.pytest-args }}' = '-m "not flaky"' ]; then
ddev env test --base --new-env --junit ${{ inputs.target }} ${{ inputs.target-env || 'all' }} -- ${{ inputs.pytest-args }} -k "not fips"
exit_code=$?
else
ddev env test --base --new-env --junit ${{ inputs.target }} ${{ inputs.target-env || 'all' }} ${{ inputs.pytest-args != '' && format('-- {0} -k "not fips"', inputs.pytest-args) || '-- -k "not fips"' }}
exit_code=$?
fi

if [ "$exit_code" -eq 5 ]; then
echo "No tests were collected."
exit 0
else
exit "$exit_code"
fi

- name: Run E2E tests
if: inputs.repo != 'core'
timeout-minutes: ${{ inputs.step-timeout-minutes }}
Expand Down
2 changes: 1 addition & 1 deletion agent_requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ clickhouse-connect==0.8.18
cm-client==45.0.4
confluent-kafka==2.11.1
cryptography==45.0.6
ddtrace==3.12.5
ddtrace==3.12.3
dnspython==2.7.0
fastavro==1.12.0
foundationdb==6.3.25
Expand Down
2 changes: 1 addition & 1 deletion datadog_checks_base/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ deps = [
"binary==1.0.2",
"cachetools==6.2.0",
"cryptography==45.0.6",
"ddtrace==3.12.5",
"ddtrace==3.12.3",
"jellyfish==1.2.0",
"lazy-loader==0.4",
"prometheus-client==0.22.1",
Expand Down
18 changes: 18 additions & 0 deletions postgres/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@
)

HERE = os.path.dirname(os.path.abspath(__file__))


def test_ddtrace_version():
"""Verify ddtrace version for this test run"""
try:
import ddtrace

version = ddtrace.__version__
print(f"\n{'=' * 60}")
print(f"DDTRACE VERSION: {version}")
print(f"{'=' * 60}\n")
# Assert the expected version for nubtron/downgrade-ddrace-2
expected_version = "3.12.3"
assert version == expected_version, f"Expected ddtrace {expected_version}, got {version}"
except ImportError:
pytest.fail("ddtrace is not installed")


INSTANCE = {
'host': HOST,
'port': PORT,
Expand Down
Loading