Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
166 lines (134 loc) · 6.45 KB
/
Copy pathpyproject.toml
File metadata and controls
166 lines (134 loc) · 6.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# ########################
# ##### PYTEST
# ########################
[tool.pytest.ini_options]
# Append these options to all pytest invocations.
addopts = [
# Treat unregistered markers as errors to avoid silent typos and ensure all markers are declared in the config.
"--strict-markers",
# Show short summary of all non-passing tests (failed, errored, skipped,
# etc.) at the end of output.
"-ra"
]
# Don't print any of these warnings during test runs.
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::UserWarning",
"ignore::pytest.PytestCollectionWarning",
]
# Custom markers for categorizing tests. These should be used in test code as
# `@pytest.mark.<marker_name>`. They can be used to select or deselect tests
# when running pytest, e.g. `pytest -m "not slow"` to run all tests except
# those marked as slow.
markers = [
"integration: Tests requiring real git operations or other I/O",
"slow: Tests that take more than 1 second",
# dagster: misc suite selection
"typesignature: Type-signature tests for pythonic resources/config",
"nettest: Requires network access",
# dagster-graphql: graphql_context_test_suite builds a context out of one
# marker from each of these groups, and tox selects on the combination.
"graphql_context_test_suite: Part of the GraphQL context test suite",
"graphql_context_variants: Tests over the GraphQL context variants themselves",
"python_client_test_suite: Python GraphQL client test suite",
"sqlite_instance: Context backed by a SQLite instance",
"postgres_instance: Context backed by a Postgres instance",
"asset_aware_instance: Context backed by an asset-aware instance",
"managed_grpc_env: Code location served by a managed gRPC server",
"deployed_grpc_env: Code location served by a deployed gRPC server",
"code_server_cli_grpc_env: Code location served via the code-server CLI",
"multi_location: Context with multiple code locations",
"lazy_repository: Context with a lazily-loaded repository",
"default_run_launcher: Context using the default run launcher",
"sync_run_launcher: Context using the synchronous run launcher",
"queued_run_coordinator: Context using the queued run coordinator",
"non_launchable: Context whose runs cannot be launched",
"read_only: Context with read-only permissions",
"backfill_daemon: Requires the backfill daemon",
# dagster-dbt
"core: dbt-core tests (applied in conftest)",
"cloud: dbt Cloud tests (applied in conftest)",
"fusion: dbt Fusion support tests",
"snowflake: Requires Snowflake",
"bigquery: Requires BigQuery",
"derived_metadata: dbt derived column metadata tests",
# dagster-snowflake
"skip_if_no_snowflake_credentials: Skipped without Snowflake credentials",
# dagster-airflow
"requires_no_db: Runs without a database",
"requires_local_db: Requires a local database",
"requires_persistent_db: Requires a persistent database",
"structures: Airflow structure tests",
# dagster-k8s / helm integration test infra
"default: Default Helm subchart configuration",
"subchart: Helm subchart tests",
"mark_redis: Requires Redis",
"mark_rabbitmq: Requires RabbitMQ",
# dagstermill
"notebook_test: Executes a notebook",
# dagster-dg-cli
"serial: Must not run in parallel",
# dagster-dbt cloud_v2 reconstruction tests (pytest-order)
"order: Explicit test ordering",
# backcompat-test-suite: applied dynamically from MARK_TO_VERSIONS_MAP
"user-code-earliest-release: User code at the earliest tested release",
"user-code-latest-release: User code at the most recent release",
]
### pytest-asyncio configuration
# Auto mode: async def test_* functions are automatically treated as async tests without
# needing @pytest.mark.asyncio on each one. Same for async fixtures.
asyncio_mode = "auto"
# Use a single event loop for the entire test session, shared across all async fixtures
# (unless a fixture explicitly declares a different scope).
asyncio_default_fixture_loop_scope = "session"
### pytest-timeout configuration
# Timeout for individual tests, in seconds. This value is intentionally large
# as it should not be the default way we catch tests that timeout. The tests
# themselves should be written such that they fail if something is taking too
# long. This is just a fallback to ensure our test suite does not hang forever.
timeout = "240"
# ########################
# ##### RUFF
# ########################
#
# The canonical ruff configuration is in ./config/ruff.toml. This file extends it with
# OSS-specific settings (excludes, per-file-ignores).
[tool.ruff]
extend = "./config/ruff.toml"
# *.py, *.ipy are included by default
extend-include = ["*.ipynb"]
extend-exclude = [
"*/__generated__/*",
"*/dagster_airflow/vendor/*",
"*/_vendored/*",
"*/snapshots/*",
"python_modules/libraries/dagstermill/dagstermill_tests/notebooks/cli_test_scaffold.ipynb",
]
[tool.ruff.lint]
# we only want to format notebooks, not lint them
exclude = ["*.ipynb"]
[tool.ruff.lint.per-file-ignores]
# Don't format docstrings in alembic migrations.
"**/alembic/versions/*.py" = ["D"]
# Modules where it is expected for there to be no __init.py__
"**/*test*/**/" = ["INP001"]
"**/setup.py" = ["INP001"]
"**/conftest.py" = ["INP001"]
"examples/**" = ["INP001"]
"docs/**" = ["INP001"]
"**/scripts/**" = ["INP001", "T201"] # scripts are CLI tools — print is the output channel
"python_modules/dagster/dagster/_core/storage/alembic/env.py" = ["INP001"]
"python_modules/dagster/dagster/_core/storage/alembic/versions/__init__.py" = ["INP001"]
"python_modules/libraries/dagster-airlift/kitchen-sink/**" = ["INP001"]
# There is an __init__.py.tmpl
"python_modules/dagster/dagster/_generate/templates/REPO_NAME_PLACEHOLDER/REPO_NAME_PLACEHOLDER/assets.py" = ["INP001"]
# Project-scaffold templates; the PROJECT_NAME_PLACEHOLDER is substituted at generation time.
"**/templates/PROJECT_NAME_PLACEHOLDER/**/__init__.py" = ["INP001"]
# User-facing connectivity reproduction script shown verbatim in the docs; print is the
# intended output channel and the dagster-cloud API config is read off the instance.
"examples/docs_snippets/docs_snippets/deployment/dagster_plus/hybrid/test_connection.py" = ["T201", "SLF001"]
# yaml_utils implements the wrapped loader; test_yaml asserts the bare yaml.safe_load behavior for comparison.
"python_modules/libraries/dagster-shared/dagster_shared/yaml_utils/__init__.py" = ["TID251"]
"python_modules/libraries/dagster-shared/dagster_shared_tests/test_yaml.py" = ["TID251"]
[tool.dagster]
module_name = "dagster_test.toys.repo"