|
50 | 50 |
|
51 | 51 | # tests |
52 | 52 | pytestCheckHook, |
53 | | - pytest-xdist, |
| 53 | + |
| 54 | + pytest-benchmark, |
54 | 55 | pytest-timeout, |
| 56 | + pytest-datafiles, |
| 57 | + pytest-xdist, |
55 | 58 | hypothesis, |
| 59 | + writableTmpDirAsHomeHook, |
56 | 60 | }: |
57 | 61 |
|
58 | 62 | buildPythonPackage rec { |
@@ -128,24 +132,86 @@ buildPythonPackage rec { |
128 | 132 |
|
129 | 133 | pythonImportsCheck = [ "atopile" ]; |
130 | 134 |
|
| 135 | + nativeCheckInputs = [ |
| 136 | + writableTmpDirAsHomeHook |
| 137 | + pytestCheckHook |
| 138 | + pytest-xdist |
| 139 | + pytest-benchmark |
| 140 | + pytest-datafiles |
| 141 | + pytest-timeout |
| 142 | + hypothesis |
| 143 | + ]; |
| 144 | + |
131 | 145 | preCheck = '' |
132 | 146 | # do not report worker logs to filee |
133 | 147 | substituteInPlace test/conftest.py \ |
134 | 148 | --replace-fail "worker_id =" "worker_id = None #" |
135 | 149 |
|
| 150 | + # unrecognized flags |
136 | 151 | substituteInPlace pyproject.toml \ |
137 | 152 | --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" |
139 | 169 | ''; |
140 | 170 |
|
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" |
146 | 212 | ]; |
147 | 213 |
|
148 | | - doCheck = false; # test are hanging |
| 214 | + doCheck = true; |
149 | 215 |
|
150 | 216 | meta = { |
151 | 217 | description = "Design circuit boards with code"; |
|
0 commit comments