# Automatic test with --disable-cli-modules doesn't load dependencies

**URL:** <https://discourse.slicer.org/t/automatic-test-with-disable-cli-modules-doesnt-load-dependencies/20478>\
**Category:** Development\
**Tags:** testing\
**Created:** [November 3, 2021, 5:13pm UTC](https://discourse.slicer.org/t/automatic-test-with-disable-cli-modules-doesnt-load-dependencies/20478 "2021-11-03T17:13:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonoxen](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/simonoxen/32/66398_2.png) [@simonoxen](https://discourse.slicer.org/u/simonoxen)\
**Post date:** [November 3, 2021, 5:13pm UTC](https://discourse.slicer.org/t/automatic-test-with-disable-cli-modules-doesnt-load-dependencies/20478/1 "2021-11-03T17:13:48Z")

</div>

Automatic tests use the `--disable-cli-modules` flag and the `--additional-module-paths` specifying cli modules. This reuslts however in the cli modules not being loaded (and thus the test failing for modules which depend on those cli).

When running the same test command without the `--disable-cli-modules` this error doesn’t occur.

See [this test](https://slicer.cdash.org/test/19994249) as reference.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 4, 2021, 3:37am UTC](https://discourse.slicer.org/t/automatic-test-with-disable-cli-modules-doesnt-load-dependencies/20478/2 "2021-11-04T03:37:24Z")

</div>

`--disable-cli-modules` slightly decreases Slicer startup time, so it is useful for tests that don’t need CLI modules. If your test requires CLI modules then separate tests could be added, but maybe it would be nicer to add an option (`TESTING_WITH_CLI` or something similar) to `slicerMacroBuildScriptedModule` in [SlicerMacroBuildScriptedModule.cmake](https://github.com/Slicer/Slicer/blob/722a18ffa6b3b3bf515cdef293de418c7844a8cc/CMake/SlicerMacroBuildScriptedModule.cmake#L23-L25) to not disable CLI modules for tests.
