• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Clinical-Genomics / cg / 8920038569

02 May 2024 07:13AM UTC coverage: 84.527%. First build
8920038569

Pull #3148

github

web-flow
Merge a6d83dc9b into 73c972545
Pull Request #3148: add(create validation case)

174 of 193 new or added lines in 7 files covered. (90.16%)

19797 of 23421 relevant lines covered (84.53%)

0.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/cg/cli/validation.py
1
"""cg module for validation ofcases."""
2

3
import logging
1✔
4
from pathlib import Path
1✔
5
from typing import Tuple
1✔
6

7
import click
1✔
8

9
from cg.constants.constants import DRY_RUN
1✔
10
from cg.meta.create_validation_cases.validation_cases_api import CreateValidationCaseAPI
1✔
11
from cg.models.cg_config import CGConfig
1✔
12

13
LOG = logging.getLogger(__name__)
1✔
14

15

16
@click.group()
1✔
17
def validation():
1✔
18
    """Validate workflows."""
19

20

21
@validation.command("create-validation-case")
1✔
22
@click.option(
1✔
23
    "-c",
24
    "--case-id",
25
    required=True,
26
    help="Case identifier used in statusdb, e.g. supersonicturtle. The case information wil be transferred to the validation case.",
27
)
28
@click.option(
1✔
29
    "-cn",
30
    "--case-name",
31
    required=True,
32
    help="Case name that is used as name for the validation case.",
33
)
34
@click.option(
1✔
35
    "-dv",
36
    "--delivery",
37
    required=False,
38
    help="Delivery option for the validation case, if not set will take delivery option from original case.",
39
)
40
@click.option(
1✔
41
    "-da",
42
    "--data-analysis",
43
    required=False,
44
    help="Data analysis option for the validation case, if not set will take data analysis option from original case.",
45
)
46
@DRY_RUN
1✔
47
@click.pass_obj
1✔
48
def create_validation_case(
1✔
49
    context: CGConfig,
50
    case_id: str,
51
    case_name: str,
52
    delivery: str,
53
    data_analysis: str,
54
    dry_run: bool,
55
):
56
    """Create a validation case to be used in workflow validation."""
NEW
57
    validation_case_api = CreateValidationCaseAPI(
×
58
        status_db=context.status_db, housekeeper_api=context.housekeeper_api
59
    )
60

NEW
61
    try:
×
NEW
62
        validation_case_api.create_validation_case(
×
63
            case_id=case_id,
64
            case_name=case_name,
65
            delivery=delivery,
66
            data_analysis=data_analysis,
67
            dry_run=dry_run,
68
        )
NEW
69
    except Exception as error:
×
NEW
70
        LOG.error(f"An error occured {repr(error)}.")
×
NEW
71
        raise click.Abort
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc