Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(test): add test command skeleton (#720) #720

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion reana_client/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import click
from urllib3 import disable_warnings

from reana_client.cli import workflow, files, ping, secrets, quotas, retention_rules
from reana_client.cli import workflow, files, ping, secrets, quotas, retention_rules, test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides fixing pydocstyle, black, flake8 etc findings, please add yourself to the AUTHORS.md file.

from reana_client.utils import get_api_url

DEBUG_LOG_FORMAT = (
Expand Down Expand Up @@ -45,6 +45,7 @@ class ReanaCLI(click.Group):
files.files_group,
retention_rules.retention_rules_group,
secrets.secrets_group,
test.test_group
]

def __init__(self, name=None, commands=None, **attrs):
Expand Down
43 changes: 43 additions & 0 deletions reana_client/cli/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import click
from reana_client.cli.utils import add_access_token_options, check_connection
from reana_client.validation.utils import (
validate_workflow_name_parameter
)


@click.group(help="Workflow run test commands")
def test_group():
"""Workflow run test commands"""

@test_group.command("test")
@click.option(
"-w",
"--workflow",
default="",
callback=validate_workflow_name_parameter,
help="Name of workflow to be tested"
)
@click.option(
"-n",
"--test_file",
default="test.feature",
help="Gherkin file for testing properties of a workflow execution"
)

@click.pass_context
@add_access_token_options
@check_connection
def test(ctx, workflow, test_file, access_token):
"""
Test workflow execution, based on a given Gherkin file.

The ``test`` command allows for testing of a workflow execution, by assessing whether it meets certain properties specified in a chosen feature file.

Example: \n
\t $ reana-client test -w myanalysis -n test_analysis.feature\n
"""
click.echo(f"Checked {workflow} using {test_file}, and everything works!") # to be changed/implemented of course

Check warning on line 39 in reana_client/cli/test.py

View check run for this annotation

Codecov / codecov/patch

reana_client/cli/test.py#L39

Added line #L39 was not covered by tests




Loading