Rex::Test::Base::run_task doesn't allow to pass arguments to tasks
Open
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 737
- Forks
- 214
- PR merge metrics
- No merged PRs in 30d
Description
In tests one often ends up with a construct along the lines of:
my $t = Rex::Test::Base->new;
$t->name('explodey_test');
$t->run_task('ACMECorp:Server:setup');
Some tasks may need some extra arguments to do something useful, e.g. useradd needing the user name. Naively one would try something like:
$t->run_task('ACMECorp:Useradd', username => 'Frank');
But due to restrictions in the code no arguments can be passed, which makes tests a lot more tedious.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Rex::Test::Base::run_task and inspect how it currently handles task arguments. Trace the existing test-task setup, then add coverage showing that arguments such as a username can be passed and used by a task; done means the example invocation works without making tests more tedious.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100