بنقرة واحدة
test-isolation
Rules for test isolation — preventing global state leakage from @eval monkeypatching
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Rules for test isolation — preventing global state leakage from @eval monkeypatching
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | test-isolation |
| description | Rules for test isolation — preventing global state leakage from @eval monkeypatching |
Mycelia's test suite runs all files in a single Julia process via
include_all_tests. Global state mutations persist across files.
NEVER use @eval Mycelia to redefine module functions in test files unless
both of the following are true:
zz_ prefix (e.g., zz_simulation_wrappers.jl) so it runs
last in alphabetical include orderMycelia.CONDA_RUNNER path (see with_fake_conda_runner pattern)MYCELIA_RUN_EXTERNAL=false@eval is unavoidable:Test.@testset "Guarded monkeypatch" begin
original = Mycelia.some_function
try
@eval Mycelia function some_function(args...)
# stub
end
# ... test code ...
finally
@eval Mycelia some_function = $original
end
end
@eval Mycelia permanently replaces methods in the module's method table for
the entire process lifetime. Files sorted alphabetically after the patching file
will silently get the stub instead of the real function. This was found in ~12
of 34 PRs during a comprehensive audit (2026-04-04), causing:
MYCELIA_RUN_EXTERNAL=true@eval Mycelia in files without zz_ prefix@eval is used, a save/restore pattern is in placesimulate_*, add_bioconda_env,
concatenate_fastq_files)Mycelia-specific test coverage expansion workflow
Staged test organization and testing guidelines for Mycelia
Diagnose and fix Lustre scratch "disk full" errors on /global/scratch when filesystem space appears available. Use for failed downloads/writes in scratch, TMPDIR issues, OST/MDT saturation, quota checks, and re-striping temp paths to healthy pools.
External tool integration and citation requirements for Mycelia
SLURM and HPC guidance for Mycelia benchmarks and large-scale analysis
Julia coding style and import rules for Mycelia package