nysus has asked for the wisdom of the Perl Monks concerning the following question:
I wrote a module that is a wrapper to a CLI for a web service. I've already written tests to cover the basic operation of the module for my specific environment where I know the CLI is installed and can see the exact output that can be expected from the CLI. I'm now in a position of thinking about what tests I need to ensure the module still works on versions of the CLI written on other systems and I'm trying to map out a general approach to these tests. I'd like to get some input from more seasoned monks on whether this makes sense and to avoid re-inventing the wheel.
First, I'm thinking if the CLI tool my module requires is not installed on a system or it is not up-to-date, I still want to install the module without failure (the user can always install or upgrade their CLI after installing my module) and skip the tests requiring the actual CLI. I plan on using some mocked up data to run the tests if it is not installed or if the CLI utility is not current. Alternatively, I could just abort the installation. I'm not sure what the best approach would be here and I'd greatly appreciate some thoughts on this.
But let's say I go with the first option and allow them to install my module without the CLI installed. When the user first fires up my module, I'm thinking I should prompt them to run the tests with the actual CLI installed. I'm thinking my module will check the status of a some kind of simple flag (maybe by the existence of file) and if it's not present, it will ask the user if they want to run the tests. After the tests run successfully, it'll set the flag to true and not prompt them again. But perhaps this is overkill? Maybe I should just ensure the output from the CLI is what is expected and abort any operation if it isn't what is expected?
TIA. I could have never gotten to this point without all the great monks here on PM!
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Post installation tests for a wrapper to a CLI utility?
by stevieb (Canon) on Jan 31, 2018 at 02:22 UTC | |
by nysus (Parson) on Jan 31, 2018 at 07:09 UTC | |
by marto (Cardinal) on Jan 31, 2018 at 09:36 UTC | |
by soonix (Chancellor) on Jan 31, 2018 at 10:47 UTC | |
by VinsWorldcom (Prior) on Jan 31, 2018 at 13:06 UTC | |
by Marshall (Canon) on Jan 31, 2018 at 20:48 UTC |