skaji / cpm

fast CPAN client
https://metacpan.org/dist/App-cpm
Other
170 stars 36 forks source link

--with-test ignored when --no-test also specified #209

Open theory opened 3 years ago

theory commented 3 years ago

I would expect that --with-test would cause cpm to install test/requires modules even with --no-test specified, but alas it does not. Seems like --no-test doesn't just mean "don't run tests" but also "don't install test modules". For example, this will not install Sqitch's test modules:

cpm install --no-test --with-test App::Sqitch

Why would I want to do this? So that I can then have all the dependencies to run tests. Currently working around this issue by downloading the cpanfile, where this does work as expected:

cpm install --no-test --with-test --cpanfile cpanfile
skaji commented 3 years ago

As described in help message, --with-* options specify types/phases of dependencies in cpanfile to be installed. So this is an expected behavior.

❯ cpm --help
...
        --with-requires,   --without-requires   (default: with)
        --with-recommends, --without-recommends (default: without)
        --with-suggests,   --without-suggests   (default: without)
        --with-configure,  --without-configure  (default: without)
        --with-build,      --without-build      (default: with)
        --with-test,       --without-test       (default: with)
        --with-runtime,    --without-runtime    (default: with)
        --with-develop,    --without-develop    (default: without)
          specify types/phases of dependencies in cpanfile to be installed
theory commented 3 years ago

Ah, right, of course. Means I can't do this pattern without a cpanfile tho. Which is fine, just need to better tame my cpanfile.