Skip to content

Commit

Permalink
Merge pull request #577 from JrGoodle/jobs
Browse files Browse the repository at this point in the history
Update clowder config set jobs command and add test
  • Loading branch information
JrGoodle committed Jun 30, 2020
2 parents e869e99 + 7ae72c6 commit fd0a984
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/clowder/cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ def add_config_set_parser(subparsers: argparse._SubParsersAction) -> None: # noq
rebase_parser.set_defaults(func=config_set_rebase)

# clowder config set jobs
jobs_parser = config_set_subparsers.add_parser('jobs', help='Set use jobs commands')
jobs_arguments = [
(['jobs'], dict(metavar='<n>', nargs=1, default=None, type=int,
help='Set default number of jobs to use runnning commands in parallel'))
]
jobs_parser = config_set_subparsers.add_parser('jobs', help='Set default number of jobs for relevant commands')
add_parser_arguments(jobs_parser, jobs_arguments)
jobs_parser.set_defaults(func=config_set_jobs)

# clowder config set projects
Expand Down Expand Up @@ -212,7 +217,7 @@ def config_set_jobs(args) -> None: # noqa

print(' - Set jobs config value')
config = _config()
config.current_clowder_config.jobs = True
config.current_clowder_config.jobs = args.jobs[0]
config.save()
print()
config.current_clowder_config.print_configuration()
Expand Down
18 changes: 18 additions & 0 deletions test/scripts/cats/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,24 @@ test_config_projects() {

test_cats_default_herd_branches

./clean.sh
./init.sh || exit 1

begin_command
$COMMAND config clear || exit 1
end_command
begin_command
$COMMAND config set jobs 4 || exit 1
end_command
begin_command
$COMMAND config get || exit 1
end_command
begin_command
$COMMAND herd || exit 1
end_command

test_cats_default_herd_branches

restore_config_file
}
test_config_projects
Expand Down

0 comments on commit fd0a984

Please sign in to comment.