Repository navigation
Description
🤖 Context for wiring the EEGLAB-ported tests into CI.
Background
#418 and #424 added 642 tests ported from sccn/eeglab_tests, tagged with @eeglab_test provenance. Ordinary pytest tests deselects all of them, so CI runs none today. They only run with --eeglab-backend matlab (the reference lane) or --eeglab-backend python. #429 pruned the agent-written unit tests on the assumption that these ported tests will become the E2E net, so this lane is what now has to protect EEGPrep's Python behavior.
Current state of the Python lane
Command (local run, 2026-10-06, branch of #429, pinned suite checkout):
uv run --no-sync pytest tests --eeglab-backend python \
--eeglab-suite-root /path/to/eeglab_tests \
-m "parity and not slow and not gui"
527 of the 642 ported tests ran; the other 115 are gui or slow. 165 passed, 362 failed or errored. The results are identical on #424's head, so the failures already existed and #429 didn't cause them.
Failure types:
| Kind | Count |
|---|---|
AttributeError, mostly a missing top-level eegprep.* name |
133 |
AssertionError, values or shape conventions differ |
71 |
ValueError |
61 |
TypeError, MATLAB-typed inputs such as float indices or structured arrays |
45 |
IndexError, 1-based vs 0-based indexing |
39 |
UnicodeDecodeError at fixture setup (STUDY sample-study fixture) |
9 |
Other: NameError: name 'disp' is not defined in test_eegh::test_reference_eegh_execute_command, plus one KeyError and one SyntaxError |
3 |
Missing top-level exports: statcond (103 tests), fdr (2), and one test each for eeg_ms2f, eeg_hist, numdim, concatdata, eegplot2trial, eegplot2event, is_sccn, iseeglabdeployed, eeg_helphelp, helpforexe.
Files with the most failures: test_statcond_eeglab_tests (103), test_mmo_eeglab_tests (33), test_core_event_eeglab_tests (20), test_pop_editeventfield_current (16), test_phase2_file_channel_location (15), test_binary_eeglab_tests (12), test_miscfunc_numerical_eeglab_tests (11), test_phase1b_file_edit_pop_functions (10).
Problems to solve first
- Backend adapter. The
eeglab_backendfixture passes MATLAB-shaped and MATLAB-typed values, for example(1, n)row vectors, float indices and struct arrays, straight into the Python functions. A conversion layer or per-function adapters are needed. The reference expectations must stay unchanged; perdocs/source/contributing.rst, a missing Python feature has to fail honestly. - Name resolution.
eeglab_backend("statcond", ...)resolves names againsteegprep. Either export the missing functions or resolve them from their modules. - STUDY fixture decoding. The
eeglab_sample_studysetup fails withUnicodeDecodeErroron byte0xb8/0xe4, which looks like a Latin-1.studyfield. - Smoke-only ports. Many ported tests only run the call and assert nothing, especially STUDY, LIMO, dipfit and event ones (see the auditor notes in [tests] Remove low-signal agent-written unit tests #429). These can't catch Python bugs even once they pass. For those areas [tests] Remove low-signal agent-written unit tests #429 kept the Python known-value tests, which shouldn't be deleted until a ported test with real assertions covers the same behavior.
- GUI tests hang. Running the lane without
-m "not gui"hung indefinitely, most likely on a modal Qt dialog underQT_QPA_PLATFORM=offscreen. CI needs per-test timeouts or GUI exclusion.
Suggested CI shape
Add a job that runs pytest tests --eeglab-backend python -m "not slow and not gui" against a pinned eeglab_tests checkout with its Git LFS data. Mark the known gaps xfail(strict=True), each linked to an issue, so new regressions fail the job and fixed gaps are noticed. Then work through the gaps from the top of the list above.
Activity
suraj-ranganath commentedon Oct 16, 2026
#487 now runs this lane in CI with no continue-on-error: 207 passed and 356 xfailed, each xfail named and raising its stable exception. This issue now covers working those xfails down, starting with statcond's keyword-only signature (103 tests), mmo, and selectevent (8 tests that now raise AttributeError on MATLAB-shaped (1, N) event arrays).
Fix single-function Python-backend parity gaps (Part of #430) (#502)
Merge develop into the browser epic branch (#628)
Merge develop into the browser epic (land with a merge commit) (#629)
Accept MATLAB struct, cell, and scalar inputs (#654)
Clear the last Python-backend xfails (#659)
suraj-ranganath commentedon Nov 21, 2026
Closing: the goal of this issue is met. The remaining EEGLAB-backend xfails were fixed across #654, #655, #656, #657, #658 and #659, and
tests/eeglab_python_backend_xfails.pyis now empty on develop (#659 merged as 73f148e).