Skip to content

Move checkInstallation to the root and speed up its import/export check#637

Merged
edkerk merged 4 commits into
develop3from
refactor/checkinstallation-root
Jun 13, 2026
Merged

Move checkInstallation to the root and speed up its import/export check#637
edkerk merged 4 commits into
develop3from
refactor/checkinstallation-root

Conversation

@edkerk

@edkerk edkerk commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

Two changes to checkInstallation, the function users run first on a fresh install.

1. Move to the RAVEN root + make it path-independent

  • Moved installation/checkInstallation.mcheckInstallation.m (root), so it's easy to find and run before RAVEN is on the path.
  • checkInstallation runs before RAVEN has been added to the MATLAB path, so it must not depend on other RAVEN functions. Its arguments are now parsed directly (nargin) instead of via parseRAVENargs (which wouldn't be found yet), and the root is resolved with a single fileparts of its own location. A docstring note explains why it can't use parseRAVENargs.
  • printOrange is shadowed by a local function, and every other RAVEN call happens after the addpath, so parseRAVENargs was the only pre-path dependency. Verified with restoredefaultpath that checkInstallation('versionOnly') runs with RAVEN off the path.

2. ~50× faster model import/export check

  • Replaced runtests('importExportTests.m') with direct import/export of the small empty tutorial model (import SBML + YAML, export SBML/YAML/Excel). ~57 s → ~1 s, no test-framework overhead or reference-model comparison.
  • Also fixes a latent bug: the old code indexed res(1..6) into importExportTests, but removing importExcelModel (and its Excel-import test) shifted those indices. The Excel-import check is dropped (the function no longer exists); Excel export is kept.

The only caller (tInstallation.m) already used positional args, so nothing else needed updating.

edkerk added 2 commits June 12, 2026 21:38
checkInstallation is the entry point run before RAVEN has been added to the
MATLAB path, so it must not depend on any other RAVEN function. It is moved
from installation/ to the RAVEN root (where it is easy to find and run on a
fresh checkout), its arguments are parsed directly instead of via
parseRAVENargs (which would not be on the path yet), and the root is now
resolved with a single fileparts of its own location.
Instead of running the full importExportTests test case (which carries the
test-framework overhead and compares against a stored reference model),
import and export the small "empty" tutorial model directly: import the
SBML and YAML files and export the model back to SBML, YAML and Excel,
each reported Pass/Fail. This is ~50x faster (about 1 s instead of ~57 s)
and no longer depends on the internal ordering of importExportTests, which
had shifted when importExcelModel (and its Excel-import test) was removed -
the Excel-import check is dropped accordingly, keeping only Excel export.
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

Function test results

201 tests   177 ✅  35s ⏱️
 22 suites   24 💤
  1 files      0 ❌

Results for commit 42d79b3.

♻️ This comment has been updated with latest results.

edkerk added 2 commits June 12, 2026 22:11
Replace the remaining runtests calls (solverTests, blastPlusTests,
diamondTests, hmmerTests) with direct checks: solve a trivial LP with each
solver, and run each bundled binary with a version/help flag to confirm it
executes. This removes checkInstallation's last dependencies on the
unit_tests, drops the test-framework overhead and the brittle res()
indexing, and is much faster. The now-unused interpretResults helper is
removed.
The matlab.unittest function_tests suite (run by CI and runRAVENtests) now
covers everything the old xUnit-style testing/unit_tests/ suite did, so the
latter is removed.

The only unique coverage in unit_tests was the end-to-end ftINIT MILP pipeline
in tinitTests.m, which tINIT.m had deferred to. That coverage is migrated into
tINIT.m as proper RavenTestCase methods (prepINITModel + ftINIT, gap filling,
metabolomics, three-step vs full, and the exact mergeLinear/groupRxnScores/
reverseRxns/rescaleModelForINIT/scoreComplexModel checks), guarded on a MILP
solver. The detailed parseTaskList text/Excel comparison is migrated into
tTasks.m.

Fixtures still used by function_tests (ecoli_textbook.mat, genomeData/, the
galactosidase FASTA files, test_tasks.*) and the tINITtestInfo/ model diagrams
are relocated to testing/function_tests/test_data and the path references
updated; the test fixtures used only by the removed suite are dropped.
@edkerk edkerk merged commit e3915d1 into develop3 Jun 13, 2026
2 checks passed
@edkerk edkerk deleted the refactor/checkinstallation-root branch June 13, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant