Files
EOS/scripts/test_durations.json
T
57905b2024 ci: run the tests in parallel jobs and speed up the Sphinx build
The single test job ran all tests one after the other on one runner,
including the Sphinx build and the Docker checks (11-19 min). It is now
split so that every test still runs exactly once:

- docs-test, docker-test: the Sphinx build (new marker "docs") and the
  Docker / Home Assistant add-on checks ("docker") in jobs of their own.
- test-server: the tests that start EOS or EOSdash on the fixed ports.
  The collection hook marks every test that uses the xprocess fixture
  with "eos_server" and puts them into one xdist group, so
  "pytest -n auto --dist loadgroup" also works locally. A test that
  binds the ports without a fixture carries the marker itself.
- test-shard: all other tests in four shards of about equal runtime
  (scripts/shard_test_files.py, runtimes in scripts/test_durations.json),
  each with pytest-xdist.
- test-count: fails if these parts do not add up to the tests of one
  plain run.
- test: keeps the name of the required check. It prints the combined
  coverage report and fails if any of the jobs above failed.

COVERAGE_CORE=sysmon measures line coverage through sys.monitoring:
the report is the same, the test time drops by about a third. The
combined report misses 1-3 statements more than a single run, in lines
that only run when a test finds state left by an earlier test.

The Sphinx build spent 74 % of its time in one search of
PythonDomain.find_obj (sphinx-doc/sphinx#11282). The local extension
docs/_ext/pyxrefindex.py answers it from an index of name endings with
the same matches in the same order; a build has a byte-identical
objects.inv. It copies the logic of Sphinx 9.0.4 and is only active for
that version; TestPyXrefIndex compares it with the installed Sphinx and
fails after a Sphinx update until the version is raised. The
documentation test builds with -j (up to four jobs); its pages can
differ from a serial build in the target of ambiguous cross-references.
Read the Docs builds without -j. Sphinx build on GitHub runners:
427-480 s -> 180-233 s.

make test-ci runs the commands of these jobs one after the other.

On GitHub runners the tests are done after about 2 minutes; the
required check ends with docs-test after about 4-5 minutes.

Additional changes
Add pytest-xdist to the development dependencies
List the 25 slowest tests in each test job (--durations=25)
Test version() directly; it was covered only through the Sphinx test
Add a "Keep Tests Fast" tip, the server marker rule, the extension and
test-ci to the development guide and the testing skill

Refs #1553

Co-authored-by: SchaafAlexander <86607129+SchaafAlexander@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: SchaafAlexander <86607129+SchaafAlexander@users.noreply.github.com>
Assisted-by: Claude Code (claude-opus-5-5)
Assisted-by: Claude Code (claude-fable-5-2)
2026-11-20 07:15:33 +01:00

137 lines
5.4 KiB
JSON

{
"tests/test_adapter.py": 0.13,
"tests/test_adapternodered.py": 0.22,
"tests/test_ai.py": 1.49,
"tests/test_cache.py": 5.97,
"tests/test_config.py": 1.38,
"tests/test_configabc.py": 4.69,
"tests/test_configmigrate.py": 0.93,
"tests/test_dataabccompact.py": 9.99,
"tests/test_dataabccontainer.py": 0.45,
"tests/test_dataabcprovider.py": 0.35,
"tests/test_dataabcrecord.py": 0.68,
"tests/test_dataabcsequence.py": 1.31,
"tests/test_dataabcsequencedb.py": 2.11,
"tests/test_database.py": 14.1,
"tests/test_databaseabc.py": 6.83,
"tests/test_datetimeutil.py": 7.63,
"tests/test_dependencywarnings.py": 0.19,
"tests/test_devicesprofilebattery.py": 4.47,
"tests/test_devicesprofilecurve.py": 0.36,
"tests/test_devicesprofileinverter.py": 0.57,
"tests/test_devicesprofilestore.py": 1.88,
"tests/test_devicessettingsbattery.py": 9.8,
"tests/test_devicessettingsinverter.py": 0.61,
"tests/test_doc.py": 0.08,
"tests/test_docstringrst.py": 4.41,
"tests/test_elecfeefixed.py": 0.68,
"tests/test_elecpriceabc.py": 0.14,
"tests/test_elecpriceakkudoktor.py": 0.45,
"tests/test_elecpriceenergycharts.py": 59.62,
"tests/test_elecpricefixed.py": 0.34,
"tests/test_elecpriceimport.py": 0.36,
"tests/test_elecpricesmard.py": 0.06,
"tests/test_elecpricetibber.py": 0.68,
"tests/test_emplan.py": 0.29,
"tests/test_emsnotify.py": 1.09,
"tests/test_eosdashcomponents.py": 0.15,
"tests/test_eosdashconfig.py": 0.12,
"tests/test_eosdashprediction.py": 1.48,
"tests/test_eosdashprofile.py": 20.24,
"tests/test_eosdashserver.py": 0.17,
"tests/test_eosdashsettings.py": 0.77,
"tests/test_eosdashwizard.py": 1.54,
"tests/test_feedintariffabc.py": 0.14,
"tests/test_feedintariffakkudoktor.py": 0.1,
"tests/test_feedintariffdvhubonline.py": 0.25,
"tests/test_feedintariffenergycharts.py": 69.21,
"tests/test_feedintarifffixed.py": 0.05,
"tests/test_feedintariffsmard.py": 0.03,
"tests/test_feedintarifftibber.py": 0.15,
"tests/test_footer.py": 0.06,
"tests/test_genetic0battery.py": 0.48,
"tests/test_genetic0inverter.py": 0.24,
"tests/test_genetic0inverterefficiency.py": 0.6,
"tests/test_genetic0optimize.py": 56.09,
"tests/test_genetic0params.py": 0.5,
"tests/test_genetic0runresult.py": 1.16,
"tests/test_genetic0simulation.py": 0.12,
"tests/test_genetic0translations.py": 0.09,
"tests/test_genetic0visualize.py": 1.82,
"tests/test_geneticacchargetotallimit.py": 0.29,
"tests/test_geneticbattery.py": 1.73,
"tests/test_geneticbatteryfullcharge.py": 3.49,
"tests/test_geneticcompletedevices.py": 1.06,
"tests/test_geneticcompleteoptimization.py": 5.75,
"tests/test_geneticcompletesimulation.py": 0.16,
"tests/test_geneticcompletesolution.py": 0.41,
"tests/test_geneticcompletetail.py": 7.59,
"tests/test_geneticcompletetimegrid.py": 1.62,
"tests/test_geneticconfigfrozenperrun.py": 0.73,
"tests/test_geneticconfigoptimizerequest.py": 3.87,
"tests/test_geneticendtoenddevices.py": 14.53,
"tests/test_geneticfitnesscachelimit.py": 3.08,
"tests/test_geneticforecastcoverage.py": 0.08,
"tests/test_genetichomeappliance.py": 1.02,
"tests/test_geneticinverter.py": 0.54,
"tests/test_geneticoptimize.py": 51.97,
"tests/test_geneticparallelevaluation.py": 10.87,
"tests/test_geneticparamsfeedin.py": 1.27,
"tests/test_geneticpdfapi.py": 1.62,
"tests/test_geneticseeding.py": 1.54,
"tests/test_geneticsimulation.py": 0.12,
"tests/test_geneticsimulation2.py": 0.07,
"tests/test_geneticvisualize.py": 9.89,
"tests/test_genticinverterefficiency.py": 0.61,
"tests/test_genticinverterefficiencycurve.py": 1.43,
"tests/test_gridinterpolator.py": 1.23,
"tests/test_heatpump.py": 0.06,
"tests/test_homeassistant.py": 0.52,
"tests/test_interpolator.py": 0.29,
"tests/test_lazyimports.py": 3.18,
"tests/test_loadakkudoktor.py": 0.98,
"tests/test_loadvrm.py": 0.1,
"tests/test_logging.py": 0.05,
"tests/test_measurement.py": 1.6,
"tests/test_measurementbatterycapacity.py": 0.57,
"tests/test_measurementenergy.py": 0.44,
"tests/test_measurementhousehold.py": 0.6,
"tests/test_optimizationcompatibility.py": 0.14,
"tests/test_prediction.py": 0.24,
"tests/test_predictionabc.py": 0.73,
"tests/test_priceabc.py": 0.2,
"tests/test_pvakkuadapt.py": 6.54,
"tests/test_pvakkuadaptquality.py": 0.26,
"tests/test_pvakkuadaptresponse.py": 0.12,
"tests/test_pvakkuadapttrend.py": 0.37,
"tests/test_pvforecast.py": 0.13,
"tests/test_pvforecastakkudoktor.py": 0.75,
"tests/test_pvforecastakkudoktorlocal.py": 13.08,
"tests/test_pvforecastakkudoktorlocalsnow.py": 3.05,
"tests/test_pvforecastforecastsolar.py": 0.8,
"tests/test_pvforecasthomeassistant.py": 0.24,
"tests/test_pvforecastimport.py": 0.39,
"tests/test_pvforecastpvlib.py": 1.47,
"tests/test_pvforecastpvnode.py": 0.31,
"tests/test_pvforecastsolcast.py": 0.25,
"tests/test_pvforecastvrm.py": 0.11,
"tests/test_pydantic.py": 0.99,
"tests/test_resterror.py": 0.33,
"tests/test_retentionmanager.py": 1.22,
"tests/test_scriptlintfilenames.py": 0.56,
"tests/test_server.py": 4.32,
"tests/test_servercleanup.py": 0.4,
"tests/test_serverendpoint.py": 0.03,
"tests/test_serverports.py": 0.5,
"tests/test_serverrestprofile.py": 1.78,
"tests/test_stringutil.py": 0.45,
"tests/test_terminalvalue.py": 0.21,
"tests/test_typingmodels.py": 0.45,
"tests/test_typingmypytooling.py": 25.45,
"tests/test_version.py": 0.94,
"tests/test_weatherbrightsky.py": 0.23,
"tests/test_weatherclearoutside.py": 0.61,
"tests/test_weatherimport.py": 0.38,
"tests/test_weatheropenmeteo.py": 0.43
}