Skip to content

Commit 93364bd

Browse files
python313Packages.apotile: enable tests
1 parent 3cf87d3 commit 93364bd

File tree

1 file changed

+74
-8
lines changed

1 file changed

+74
-8
lines changed

pkgs/development/python-modules/atopile/default.nix

Lines changed: 74 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@
5050

5151
# tests
5252
pytestCheckHook,
53-
pytest-xdist,
53+
54+
pytest-benchmark,
5455
pytest-timeout,
56+
pytest-datafiles,
57+
pytest-xdist,
5558
hypothesis,
59+
writableTmpDirAsHomeHook,
5660
}:
5761

5862
buildPythonPackage rec {
@@ -128,24 +132,86 @@ buildPythonPackage rec {
128132

129133
pythonImportsCheck = [ "atopile" ];
130134

135+
nativeCheckInputs = [
136+
writableTmpDirAsHomeHook
137+
pytestCheckHook
138+
pytest-xdist
139+
pytest-benchmark
140+
pytest-datafiles
141+
pytest-timeout
142+
hypothesis
143+
];
144+
131145
preCheck = ''
132146
# do not report worker logs to filee
133147
substituteInPlace test/conftest.py \
134148
--replace-fail "worker_id =" "worker_id = None #"
135149
150+
# unrecognized flags
136151
substituteInPlace pyproject.toml \
137152
--replace-fail "--html=artifacts/test-report.html" "" \
138-
--replace-fail "--self-contained-html" ""
153+
--replace-fail "--self-contained-html" "" \
154+
--replace-fail "--numprocesses=auto" "" \
155+
156+
# Replace this function call that cause test to hang
157+
substituteInPlace \
158+
test/cli/test_packages.py \
159+
test/library/test_names.py \
160+
test/test_examples.py \
161+
test/test_parse_utils.py \
162+
--replace-fail "_repo_root()" "Path('$(pwd)')"
163+
164+
# Fix crash due to empty list in fixture tests
165+
substituteInPlace \
166+
test/test_examples.py \
167+
test/test_parse_utils.py \
168+
--replace-fail "p.stem" "p.stem if isinstance(p, Path) else p"
139169
'';
140170

141-
nativeCheckInputs = [
142-
pytestCheckHook
143-
pytest-xdist
144-
pytest-timeout
145-
hypothesis
171+
disabledTestPaths = [
172+
# timouts
173+
"test/test_cli.py"
174+
"test/cli/test_packages.py"
175+
"test/end_to_end/test_net_naming.py"
176+
"test/end_to_end/test_pcb_export.py"
177+
"test/exporters/bom/test_bom.py"
178+
"test/front_end/test_front_end_pick.py"
179+
"test/libs/picker/test_pickers.py"
180+
];
181+
182+
disabledTests = [
183+
# timeout
184+
"test_build_error_logging"
185+
"test_performance_mifs_bus_params"
186+
"test_resistor"
187+
"test_reserved_attrs"
188+
# requires internet
189+
"test_simple_pick"
190+
"test_simple_negative_pick"
191+
"test_jlcpcb_pick_resistor"
192+
"test_jlcpcb_pick_capacitor"
193+
"test_regression_rp2040_usb_diffpair_full"
194+
"test_model_translations"
195+
# type error
196+
"test_alternate_trait_constructor_with_params"
197+
"test_parameterised_trait_with_params"
198+
"test_trait_alternate_constructor_precedence"
199+
"test_trait_template_enum"
200+
"test_trait_template_enum_invalid"
201+
# failure
202+
"test_solve_voltage_divider_complex"
203+
];
204+
205+
# in order to use pytest marker, we need to use ppytestFlagsArray
206+
# using pytestFlags causes `ERROR: file or directory not found: slow`
207+
pytestFlagsArray = [
208+
"-m='not slow and not not_in_ci and not regression'"
209+
"--timeout=10" # any test taking long, timouts with more than 60s
210+
"--benchmark-disable"
211+
"--tb=line"
146212
];
147213

148-
doCheck = false; # test are hanging
214+
doCheck = true;
149215

150216
meta = {
151217
description = "Design circuit boards with code";

0 commit comments

Comments
 (0)