Skip to content

Commit

Permalink
Override the default test options for some integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentClarret committed Sep 7, 2023
1 parent c758504 commit 5225655
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- datadog_checks_base/datadog_checks/**
- datadog_checks_dev/datadog_checks/dev/*.py
- ddev/src/**
- "!datadog_checks_base/datadog_checks/base/data/agent_requirements.in"

concurrency:
Expand Down
1 change: 1 addition & 0 deletions datadog_checks_dev/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ matrix.python.features = [
]
matrix.python.scripts = [
{ key = "test", value = "_dd-test --ignore tests/tooling", if = ["2.7"] },
{ key = "test-cov", value = "_dd-test-cov --ignore tests/tooling", if = ["2.7"] },
]
# TODO: remove this when the old CLI is gone
matrix.python.pre-install-commands = [
Expand Down
5 changes: 0 additions & 5 deletions datadog_checks_downloader/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
[[envs.default.matrix]]
python = ["3.9"]

[envs.default.overrides]
matrix.python.scripts = [
{ key = "test", value = "_dd-test --capture=no --log-cli-level=debug" },
]

[envs.default]
e2e-env = false
dependencies = [
Expand Down
3 changes: 3 additions & 0 deletions datadog_checks_downloader/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ include = [
dev-mode-dirs = [
".",
]

[tool.pytest.ini_options]
addopts = "--capture=no --log-cli-level=debug"
1 change: 1 addition & 0 deletions ddev/src/ddev/cli/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def test(
in_ci = running_in_ci()

global_env_vars: dict[str, str] = {}
global_env_vars['PYTEST_TESTPATHS'] = os.environ.get('PYTEST_TESTPATHS', 'tests')

hatch_verbosity = app.verbosity + 1
if hatch_verbosity > 0:
Expand Down
6 changes: 3 additions & 3 deletions ddev/src/ddev/plugin/external/hatch/environment_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ def finalize_config(self, config):
scripts['_dd-install-packages'] = install_commands
env_config.setdefault('post-install-commands', []).insert(0, '_dd-install-packages')

scripts['_dd-test'] = ['pytest -vv --benchmark-skip {args:tests}']
scripts['_dd-test'] = ['pytest -vv --benchmark-skip {args}']
scripts['_dd-test-cov'] = [
f'pytest -vv --benchmark-skip --cov {self.package_directory} --cov tests '
f'--cov-config=../.coveragerc --cov-report= --cov-append {{args:tests}}',
f'--cov-config=../.coveragerc --cov-report= --cov-append {{args}}',
]
scripts['_dd-benchmark'] = ['pytest -vv --benchmark-only --benchmark-cprofile=tottime {args:tests}']
scripts['_dd-benchmark'] = ['pytest -vv --benchmark-only --benchmark-cprofile=tottime {args}']

# Set defaults that will be called but allow users to override while
# retaining access to them for reuse
Expand Down
1 change: 1 addition & 0 deletions teamcity/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ matrix.impl.env-vars = [
]
matrix.python.scripts = [
{ key = "test", value = "_dd-test --ignore=tests/docker" },
{ key = "test-cov", value = "_dd-test-cov --ignore=tests/docker" },
]

[envs.default.env-vars]
Expand Down
3 changes: 3 additions & 0 deletions teamcity/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ include = [
dev-mode-dirs = [
".",
]

[tool.pytest.ini_options]
addopts = "--ignore=tests/docker"
1 change: 1 addition & 0 deletions win32_event_log/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ platforms = [
[envs.default.overrides]
matrix.python.scripts = [
{ key = "test", value = "pytest -v --benchmark-skip tests/legacy", if = ["2.7"] },
{ key = "test-cov", value = "pytest -v --benchmark-skip tests/legacy", if = ["2.7"] },
]

0 comments on commit 5225655

Please sign in to comment.