RexOps / RexOps/Rex

Rex::Test::Base::run_task doesn't allow to pass arguments to tasks

Open
#831 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.