Skip to content

Commit

Permalink
ci: simplify suitespec doctest (#8526)
Browse files Browse the repository at this point in the history
We simplify the suitespec doctest case to avoid having to make changes
to it when the actual suitespec file is modified.

## Checklist

- [ ] Change(s) are motivated and described in the PR description
- [ ] Testing strategy is described if automated tests are not included
in the PR
- [ ] Risks are described (performance impact, potential for breakage,
maintainability)
- [ ] Change is maintainable (easy to change, telemetry, documentation)
- [ ] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed or label `changelog/no-changelog` is set
- [ ] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/))
- [ ] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))
- [ ] If this PR changes the public interface, I've notified
`@DataDog/apm-tees`.
- [ ] If change touches code that signs or publishes builds or packages,
or handles credentials of any kind, I've requested a review from
`@DataDog/security-design-and-guidance`.

## Reviewer Checklist

- [ ] Title is accurate
- [ ] All changes are related to the pull request's stated goal
- [ ] Description motivates each change
- [ ] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- [ ] Testing strategy adequately addresses listed risks
- [ ] Change is maintainable (easy to change, telemetry, documentation)
- [ ] Release note makes sense to a user of the library
- [ ] Author has acknowledged and discussed the performance implications
of this PR as reported in the benchmarks PR comment
- [ ] Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
  • Loading branch information
P403n1x87 committed Feb 27, 2024
1 parent acc0297 commit 9fff66c
Showing 1 changed file with 3 additions and 74 deletions.
77 changes: 3 additions & 74 deletions tests/suitespec.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,83 +12,12 @@
def get_patterns(suite: str) -> t.Set[str]:
"""Get the patterns for a suite
>>> SUITESPEC["components"] = {"$h": ["tests/s.py"], "core": ["core/*"], "debugging": ["ddtrace/d/*"]}
>>> SUITESPEC["suites"] = {"debugger": ["@core", "@debugging", "tests/d/*"]}
>>> sorted(get_patterns("debugger")) # doctest: +NORMALIZE_WHITESPACE
['.circleci/*', 'ddtrace/__init__.py', 'ddtrace/_hooks.py', 'ddtrace/_logger.py', 'ddtrace/_monkey.py',
'ddtrace/_trace/*', 'ddtrace/auto.py', 'ddtrace/bootstrap/*', 'ddtrace/commands/*', 'ddtrace/constants.py',
'ddtrace/context.py', 'ddtrace/debugging/*', 'ddtrace/filters.py', 'ddtrace/internal/__init__.py',
'ddtrace/internal/_encoding.py*', 'ddtrace/internal/_rand.pyi', 'ddtrace/internal/_rand.pyx',
'ddtrace/internal/_stdint.h', 'ddtrace/internal/_tagset.py*', 'ddtrace/internal/_utils.*',
'ddtrace/internal/agent.py', 'ddtrace/internal/assembly.py', 'ddtrace/internal/atexit.py',
'ddtrace/internal/compat.py', 'ddtrace/internal/constants.py', 'ddtrace/internal/core/*',
'ddtrace/internal/datadog/__init__.py', 'ddtrace/internal/debug.py', 'ddtrace/internal/dogstatsd.py',
'ddtrace/internal/encoding.py', 'ddtrace/internal/forksafe.py', 'ddtrace/internal/gitmetadata.py',
'ddtrace/internal/glob_matching.py', 'ddtrace/internal/hostname.py', 'ddtrace/internal/http.py',
'ddtrace/internal/injection.py', 'ddtrace/internal/logger.py', 'ddtrace/internal/metrics.py',
'ddtrace/internal/module.py', 'ddtrace/internal/pack.h', 'ddtrace/internal/pack_template.h',
'ddtrace/internal/packages.py', 'ddtrace/internal/peer_service/*', 'ddtrace/internal/periodic.py',
'ddtrace/internal/processor/__init__.py', 'ddtrace/internal/processor/stats.py',
'ddtrace/internal/rate_limiter.py', 'ddtrace/internal/remoteconfig/*', 'ddtrace/internal/runtime/*',
'ddtrace/internal/safety.py', 'ddtrace/internal/sampling.py', 'ddtrace/internal/schema/*',
'ddtrace/internal/service.py', 'ddtrace/internal/sma.py', 'ddtrace/internal/sysdep.h',
'ddtrace/internal/tracemethods.py', 'ddtrace/internal/uds.py', 'ddtrace/internal/utils/*',
'ddtrace/internal/uwsgi.py', 'ddtrace/internal/wrapping/*', 'ddtrace/internal/writer/*', 'ddtrace/pin.py',
'ddtrace/provider.py', 'ddtrace/py.typed', 'ddtrace/sampler.py', 'ddtrace/sampling_rule.py',
'ddtrace/settings/__init__.py', 'ddtrace/settings/config.py', 'ddtrace/settings/dynamic_instrumentation.py',
'ddtrace/settings/exception_debugging.py', 'ddtrace/settings/exceptions.py', 'ddtrace/settings/http.py',
'ddtrace/settings/integration.py', 'ddtrace/settings/peer_service.py', 'ddtrace/span.py', 'ddtrace/tracer.py',
'ddtrace/tracing/*', 'ddtrace/version.py', 'docker-compose.yml', 'docker/*', 'hatch.toml', 'pyproject.toml',
'riotfile.py', 'scripts/ddtest', 'scripts/run-test-suite', 'setup.cfg', 'setup.py', 'tests/.suitespec.json',
'tests/__init__.py', 'tests/conftest.py', 'tests/debugging/*',
'tests/lib-injection/dd-lib-python-init-test-django-gunicorn-alpine/*',
'tests/lib-injection/dd-lib-python-init-test-django-gunicorn/*',
'tests/lib-injection/dd-lib-python-init-test-django-no-perms/*',
'tests/lib-injection/dd-lib-python-init-test-django-pre-installed/*',
'tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/*',
'tests/lib-injection/dd-lib-python-init-test-django-uvicorn/*',
'tests/lib-injection/dd-lib-python-init-test-django/*', 'tests/meta/*', 'tests/smoke_test.py',
'tests/subprocesstest.py', 'tests/suitespec.py', 'tests/test_module/*', 'tests/utils.py',
'tests/wait-for-services.py', 'tests/webclient.py']
['core/*', 'ddtrace/d/*', 'tests/d/*', 'tests/s.py']
>>> get_patterns("foobar")
set()
>>> sorted(get_patterns("urllib3")) # doctest: +NORMALIZE_WHITESPACE
['.circleci/*', 'ddtrace/__init__.py', 'ddtrace/_hooks.py', 'ddtrace/_logger.py', 'ddtrace/_monkey.py',
'ddtrace/_trace/*', 'ddtrace/auto.py', 'ddtrace/bootstrap/*', 'ddtrace/commands/*', 'ddtrace/constants.py',
'ddtrace/context.py', 'ddtrace/contrib/__init__.py', 'ddtrace/contrib/trace_utils.py',
'ddtrace/contrib/trace_utils_async.py', 'ddtrace/contrib/urllib3/*', 'ddtrace/ext/__init__.py',
'ddtrace/ext/http.py', 'ddtrace/ext/net.py', 'ddtrace/ext/sql.py', 'ddtrace/ext/test.py', 'ddtrace/ext/user.py',
'ddtrace/filters.py', 'ddtrace/internal/__init__.py', 'ddtrace/internal/_encoding.py*',
'ddtrace/internal/_rand.pyi', 'ddtrace/internal/_rand.pyx', 'ddtrace/internal/_stdint.h',
'ddtrace/internal/_tagset.py*', 'ddtrace/internal/_utils.*', 'ddtrace/internal/agent.py',
'ddtrace/internal/assembly.py', 'ddtrace/internal/atexit.py', 'ddtrace/internal/compat.py',
'ddtrace/internal/constants.py', 'ddtrace/internal/core/*', 'ddtrace/internal/datadog/__init__.py',
'ddtrace/internal/debug.py', 'ddtrace/internal/dogstatsd.py', 'ddtrace/internal/encoding.py',
'ddtrace/internal/forksafe.py', 'ddtrace/internal/gitmetadata.py', 'ddtrace/internal/glob_matching.py',
'ddtrace/internal/hostname.py', 'ddtrace/internal/http.py', 'ddtrace/internal/injection.py',
'ddtrace/internal/logger.py', 'ddtrace/internal/metrics.py', 'ddtrace/internal/module.py',
'ddtrace/internal/pack.h', 'ddtrace/internal/pack_template.h', 'ddtrace/internal/packages.py',
'ddtrace/internal/peer_service/*', 'ddtrace/internal/periodic.py', 'ddtrace/internal/processor/__init__.py',
'ddtrace/internal/processor/stats.py', 'ddtrace/internal/rate_limiter.py', 'ddtrace/internal/runtime/*',
'ddtrace/internal/safety.py', 'ddtrace/internal/sampling.py', 'ddtrace/internal/schema/*',
'ddtrace/internal/service.py', 'ddtrace/internal/sma.py', 'ddtrace/internal/sysdep.h',
'ddtrace/internal/tracemethods.py', 'ddtrace/internal/uds.py', 'ddtrace/internal/utils/*',
'ddtrace/internal/uwsgi.py', 'ddtrace/internal/wrapping/*', 'ddtrace/internal/writer/*', 'ddtrace/pin.py',
'ddtrace/propagation/*', 'ddtrace/provider.py', 'ddtrace/py.typed', 'ddtrace/sampler.py',
'ddtrace/sampling_rule.py', 'ddtrace/settings/__init__.py', 'ddtrace/settings/_database_monitoring.py',
'ddtrace/settings/config.py', 'ddtrace/settings/exceptions.py', 'ddtrace/settings/http.py',
'ddtrace/settings/integration.py', 'ddtrace/settings/peer_service.py', 'ddtrace/span.py', 'ddtrace/tracer.py',
'ddtrace/tracing/*', 'ddtrace/version.py', 'docker-compose.yml', 'docker/*', 'hatch.toml', 'pyproject.toml',
'riotfile.py', 'scripts/ddtest', 'scripts/run-test-suite', 'setup.cfg', 'setup.py', 'tests/.suitespec.json',
'tests/__init__.py', 'tests/conftest.py', 'tests/contrib/__init__.py', 'tests/contrib/config.py',
'tests/contrib/patch.py', 'tests/contrib/urllib3/*',
'tests/lib-injection/dd-lib-python-init-test-django-gunicorn-alpine/*',
'tests/lib-injection/dd-lib-python-init-test-django-gunicorn/*',
'tests/lib-injection/dd-lib-python-init-test-django-no-perms/*',
'tests/lib-injection/dd-lib-python-init-test-django-pre-installed/*',
'tests/lib-injection/dd-lib-python-init-test-django-unsupported-python/*',
'tests/lib-injection/dd-lib-python-init-test-django-uvicorn/*',
'tests/lib-injection/dd-lib-python-init-test-django/*', 'tests/meta/*', 'tests/smoke_test.py',
'tests/snapshots/tests.contrib.urllib3.*', 'tests/subprocesstest.py', 'tests/suitespec.py', 'tests/test_module/*',
'tests/utils.py', 'tests/wait-for-services.py', 'tests/webclient.py']
"""
compos = SUITESPEC["components"]
if suite not in SUITESPEC["suites"]:
Expand Down

0 comments on commit 9fff66c

Please sign in to comment.