Skip to content

Commit

Permalink
Update CLI to use invocation_id argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Nov 29, 2023
1 parent 4d5fb8e commit 7962c34
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/commands/workflow_test_on_invocation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This section is auto-generated from the help text for the planemo command

**Usage**::

planemo workflow_test_on_invocation [OPTIONS] TEST DEFINITION
planemo workflow_test_on_invocation [OPTIONS] TEST DEFINITION INVOCATION

**Help**

Expand Down
6 changes: 3 additions & 3 deletions planemo/commands/cmd_workflow_test_on_invocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

@click.command("workflow_test_on_invocation")
@options.optional_tools_arg(multiple=False, allow_uris=False, metavar="TEST DEFINITION")
@options.required_workflow_arg()
@options.required_invocation_id_arg()
@options.galaxy_url_option(required=True)
@options.galaxy_user_key_option(required=True)
@options.test_index_option()
@options.test_output_options()
@command_function
def cli(ctx, path, workflow_identifier, test_index, **kwds):
def cli(ctx, path, invocation_id, test_index, **kwds):
"""Run defined tests against existing workflow invocation."""
with engine_context(ctx, engine="external_galaxy", **kwds) as engine, engine.ensure_runnables_served([]) as config:
user_gi = config.user_gi
invocation = user_gi.invocations.show_invocation(workflow_identifier)
invocation = user_gi.invocations.show_invocation(invocation_id)
runnable = for_runnable_identifier(ctx, f"{GALAXY_WORKFLOW_INSTANCE_PREFIX}{invocation['workflow_id']}", kwds)
test_cases = definition_to_test_case(path, runnable)
assert (
Expand Down
8 changes: 8 additions & 0 deletions planemo/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,14 @@ def required_workflow_arg():
)


def required_invocation_id_arg():
return click.argument(
"invocation_id",
metavar="INVOCATION ID",
type=str,
)


def split_job_and_test():
return click.option(
"--split_test/--no_split_test", default=False, help="Write workflow job and test definitions to separate files."
Expand Down

0 comments on commit 7962c34

Please sign in to comment.