Skip to content
Open
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
15 changes: 7 additions & 8 deletions teamcity/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@

@pytest.fixture(scope='session')
def dd_environment(rest_instance, openmetrics_instance):
compose_file = COMPOSE_FILE.format('mockserver')
instance = rest_instance
endpoints = None
conditions = None
if USE_OPENMETRICS:
compose_file = COMPOSE_FILE.format('teamcity_server')
instance = openmetrics_instance
endpoints = [METRIC_ENDPOINT]
conditions = [CheckDockerLogs('teamcity-server', ['TeamCity initialized'], attempts=100, wait=3)]
with docker_run(compose_file, endpoints=[METRIC_ENDPOINT], conditions=conditions, sleep=10):
yield openmetrics_instance
return

with docker_run(compose_file, endpoints=endpoints, conditions=conditions, sleep=10):
yield instance
compose_file = COMPOSE_FILE.format('mockserver')
conditions = [CheckDockerLogs(compose_file, ['started on port: 8111'], attempts=60, wait=2)]
with docker_run(compose_file, conditions=conditions, wait_for_health=False, sleep=2):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove unsupported docker_run keyword

When USE_OPENMETRICS is false, this fixture now calls docker_run(..., wait_for_health=False, ...), but the dev helper's signature is docker_run(..., waith_for_health=False, ...) and does not accept wait_for_health (confirmed via inspect.signature(datadog_checks.dev.docker_run)). As a result the legacy/mockserver TeamCity tests raise TypeError: docker_run() got an unexpected keyword argument 'wait_for_health' before starting Docker, so this path is broken instead of just bypassing the healthcheck.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has an outdated version of the API, we already fixed this.

yield rest_instance


@pytest.fixture(scope='session')
Expand Down
Loading