-
Notifications
You must be signed in to change notification settings - Fork 10
/
pyproject.toml
295 lines (278 loc) · 7.6 KB
/
pyproject.toml
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
[project]
name = 'system_tests'
version = '0.0.1'
[tool.setuptools]
packages = ["tests", "utils", "manifests"]
[tool.pytest.ini_options]
addopts = "--json-report --json-report-indent=2 --color=yes --no-header --junitxml=reportJunit.xml -r Xf"
testpaths = [
"tests",
]
# log_cli = True
# log_cli_level = DEBUG
log_level = "DEBUG"
log_format = "%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s"
log_date_format = "%H:%M:%S"
log_file_format = "%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s"
log_file_date_format = "%H:%M:%S"
junit_family = "xunit2"
junit_logging = "no"
junit_duration_report = "call"
junit_suite_name = "system_tests_suite"
markers =[
"scenario: run a test only for a specified scenario",
"features: declare the feature id"
]
python_files = "test_*.py *utils.py"
# migration tooling: list of folders where feature declarations are mandatory
# once every test class got its feature declaration, we can remove this
allow_no_feature_nodes = [
"tests/apm_tracing_e2e/test_single_span.py",
"tests/apm_tracing_e2e/test_smoke.py",
"tests/otel_tracing_e2e/test_e2e.py",
"tests/parametric/test_span_links.py",
"tests/parametric/test_tracer.py",
"tests/perfs/test_performances.py", # exotic scenario, not really used
"tests/test_the_test/", # Not a real test
]
[tool.mypy]
files = ["utils/parametric", "tests/parametric"]
ignore_missing_imports = true
check_untyped_defs = true
disable_error_code = ["no-redef"]
exclude = 'utils/parametric/_library_client\.py|^(?!utils/parametric|tests/parametric).*$'
follow_imports = "skip"
# enable_error_code = ["ignore-without-code"]
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py312"
[tool.ruff.format]
exclude = [
"venv/",
"utils/grpc/weblog_pb2_grpc.py",
"utils/grpc/weblog_pb2.py", "parametric/apps",
"lib-injection/build/docker/python/dd-lib-python-init-test-protobuf-old/addressbook_pb2.py"
]
quote-style = "double"
indent-style = "space"
# skip-magic-trailing-comma = false
# line-ending = "auto"
# docstring-code-format = false
# docstring-code-line-length = "dynamic"
[tool.ruff.lint]
exclude = [
"docs/*",
]
select = ["ALL"]
ignore = [
### TODO : remove those ignores
# missing-type-annotation, the ONE to remove !!
"ANN001",
"ANN002",
"ANN003",
"ANN201",
"ANN202",
"ANN205",
"ANN206",
"BLE001", # Do not catch blind exception: `Exception`, big project to enable this
"C901", # code complexity, TBD
"E722", # bare except, big project to enable this
"PERF401", # TBD, the "good" code can be harder to read
"PLR0911", # too many return, may be replaced by a higher default value
"PLR0912", # Too many branches
"PLR0913", # too many arguments, may be replaced by a higher default value
"PLR0915", # too many statements, may be replaced by a higher default value
"PLR1714",
"PLR2004",
"PTH100",
"PTH102",
"PTH110",
"PTH113",
"PTH116",
"PTH118",
"PTH119",
"PTH120",
"PTH122",
"PTH123", # `open()` should be replaced by `Path.open()`
"RUF012",
"S202",
"SIM102",
"SIM110", # TBD
"TRY003", # this is a full project to enable this
### Ignores that will be kept for the entire project
"ANN204", # missing-return-type-special-method
"COM812", # ruff format recommend ignoring this
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in `__init__`
"D202", # blank line after docstring
"D203", # cause a warning
"D205", # PEP 257 : blank line after first docstring line
"D211", # no-blank-line-before-class
"D213", # multi-line-summary-second-line
"D400", # First line should end with a period
"D401", # PEP 257 : blank line after first docstring line
"D406", # we are not using numpy convention for docstrings
"D407", # we are not using reStructuredText for docstrings
"D415", # First line should end with a period
"EM101", # Exception must not use a string literal => painful
"EM102", # Exception must not use an f-string => painful
"ERA001", # Found commented-out code
"FIX001", # Fixme found
"FIX002", # Fixme found
"G004", # allow logging with f-string
"I001", # Import block is un-sorted or un-formatted
"ISC001", # ruff format recommend ignoring this
"PTH207", # allow using glob.glob
"S101", # we allow assert!
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes -> it's testing
"S324", # testing, it's fine
"S603", # allow untrusted input for subprocess
"S607", # allow relative process call
"TD001", # todo found
"TD002", # todo found
"TD003", # todo found
"TD004", # todo found
"TRY300", # not always obvious
"UP038", # not a big fan
]
[tool.ruff.lint.per-file-ignores]
"utils/grpc/weblog_pb2_grpc.py" = ["ALL"]
"utils/grpc/weblog_pb2.py" = ["ALL"]
"utils/scripts/*" = [
"INP001", # this is not a package
"T201" # allow print statements in scripts folder
]
"utils/interfaces/schemas/serve_doc.py" = ["INP001"] # this is not a package
"utils/waf_rules.py" = ["N801"] # generated file
# TODO : remove those ignores
"tests/*" = ["ALL"]
"utils/build/*" = ["ALL"]
"lib-injection/*" = ["ALL"]
"utils/{k8s_lib_injection/*,_context/_scenarios/k8s_lib_injection.py}" = [
"TRY201",
"TRY002",
"D207",
"SIM115",
"S603",
"DTZ005",
"E501", # line too long
"FBT002", # Boolean default positional argument
"SLF001",
"RET505",
"TRY301",
"B006",
"SIM108",
"RET508",
"B007",
"E712",
"F541",
"TRY400",
"N818",
"UP004",
"PTH109",
"UP032",
"EM103",
"B904",
"PTH108",
"A002",
"E401",
"RUF012",
"G002",
"UP031",
"F541"
]
"utils/onboarding/*" = [
"DTZ006",
"DTZ005",
"E501", # line too long
"FBT002", # Boolean default positional argument
"UP017",
"N806",
"FBT001",
"S507",
"PTH102",
"PLR2044",
"N803",
"RET505",
]
"utils/{_context/_scenarios/docker_ssi.py,docker_ssi/docker_ssi_matrix_builder.py,docker_ssi/docker_ssi_matrix_utils.py}" = [
"PLR2004",
"E501", # line too long
"SIM210",
"RET504",
"RET505",
"SIM108",
"T201",
]
"utils/_context/virtual_machines.py" = [
"ARG002", # unused method argument
"FBT002", # Boolean default positional argument
"N801", # class naming
"S507", # Paramiko call with policy set to automatically trust the unknown host key
]
"utils/virtual_machine/*" = [
"A002",
"ANN002",
"ANN201",
"ARG001",
"ARG002",
"C901",
"E712",
"E731",
"E501", # line too long
"FBT002", # Boolean default positional argument
"F541",
"E713",
"EM102",
"PLR0912",
"PLR0915",
"PLR1714",
"PLW1510",
"PTH112",
"PTH113",
"PTH116",
"PTH118",
"PTH119",
"RET503",
"RET504",
"RET508",
"RET505",
"RUF013",
"S506",
"S603",
"SIM102",
"SIM113",
"SIM300",
"SIM401", # code quality, TBD
"UP008",
"UP015",
"UP031",
"UP024",
"BLE001",
"D207",
"F401",
"F811",
"F841",
"N802",
"N803",
"N806",
"PERF401",
"PLR2004",
"PTH101",
"PTH102",
"PTH109",
"S103",
"S113",
"S311",
"S602",
"SIM103",
"SIM115",
"SLF001",
"TRY002",
]