Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-datadog committed Jul 5, 2024
1 parent 1f7fe9c commit 695e8ff
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
description: "Arguments to pass to pytest"
required: false
type: string
default: "-m flaky"
default: ""

jobs:
compute-matrix:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ jobs:
uses: ./.github/workflows/pr-test.yml
with:
repo: core
pytest-args: '-m flaky'
secrets: inherit
30 changes: 20 additions & 10 deletions .github/workflows/test-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,12 @@ jobs:
env:
DDEV_TEST_ENABLE_TRACING: "${{ inputs.repo == 'core' && '1' || '0' }}"
run: |
if [ -n "${{ inputs.pytest-args }}" ]; then
if [ "${{ inputs.pytest-args }}" = "-m flaky" ]; then
set +e # Disable immediate exit
ddev test --cov --junit ${{ inputs.target }} -- ${{ inputs.pytest-args }}
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
Expand All @@ -230,11 +231,12 @@ jobs:
- name: Run Unit & Integration tests with minimum version of base package
if: inputs.standard && inputs.minimum-base-package
run: |
if [ -n "${{ inputs.pytest-args }}" ]; then
set +e
if [ "${{ inputs.pytest-args }}" = "-m flaky" ]; then
set +e # Disable immediate exit
ddev test --compat --recreate --junit ${{ inputs.target }} -- ${{ inputs.pytest-args }}
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
Expand All @@ -249,11 +251,12 @@ jobs:
env:
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
run: |
if [ -n "${{ inputs.pytest-args }}" ]; then
set +e
if [ "${{ inputs.pytest-args }}" = "-m flaky" ]; then
set +e # Disable immediate exit
ddev env test --base --new-env --junit ${{ inputs.target }} -- all ${{ inputs.pytest-args }}
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
Expand All @@ -268,11 +271,12 @@ jobs:
env:
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
run: |
if [ -n "${{ inputs.pytest-args }}" ]; then
set +e
if [ "${{ inputs.pytest-args }}" = "-m flaky" ]; then
set +e # Disable immediate exit
ddev env test --new-env --junit ${{ inputs.target }} -- all ${{ inputs.pytest-args }}
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
Expand All @@ -296,11 +300,12 @@ jobs:
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
DDEV_TEST_ENABLE_TRACING: "${{ inputs.repo == 'core' && '1' || '0' }}"
run: |
if [ -n "${{ inputs.pytest-args }}" ]; then
set +e
if [ "${{ inputs.pytest-args }}" = "-m flaky" ]; then
set +e # Disable immediate exit
ddev env test --base --new-env --junit ${{ inputs.target }}:latest -- all ${{ inputs.pytest-args }}
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
Expand Down Expand Up @@ -337,7 +342,12 @@ jobs:
path: "${{ env.TEST_RESULTS_BASE_DIR }}"

- name: Upload coverage data
if: inputs.standard && !github.event.repository.private && always() && inputs.pytest-args != '-m flaky'
if: >
inputs.standard &&
!github.event.repository.private &&
always() &&
inputs.pytest-args != '-m flaky'
# Flaky tests will have low coverage, don't upload it to avoid pipeline failure
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
4 changes: 0 additions & 4 deletions activemq_xml/datadog_checks/activemq_xml/activemq_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@


class ActiveMQXML(AgentCheck):
"""
Dummy doc string to trigger tests
"""

def check(self, _):
url = self.instance.get("url")
custom_tags = self.instance.get('tags', [])
Expand Down
1 change: 0 additions & 1 deletion postgres/tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
pytestmark = pytest.mark.unit


@pytest.mark.flaky
def test_get_instance_metrics_lt_92(integration_check, pg_instance):
"""
check output when 9.2+
Expand Down
4 changes: 0 additions & 4 deletions sqlserver/datadog_checks/sqlserver/sqlserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@


class SQLServer(AgentCheck):
"""
Dummy docstring to trigger tests
"""

__NAMESPACE__ = "sqlserver"

def __init__(self, name, init_config, instances):
Expand Down

0 comments on commit 695e8ff

Please sign in to comment.