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

Clinical-Genomics / cg / 8892829037

30 Apr 2024 09:55AM UTC coverage: 84.455%. First build
8892829037

Pull #3148

github

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

153 of 188 new or added lines in 6 files covered. (81.38%)

19776 of 23416 relevant lines covered (84.46%)

0.84 hits per line

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

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

NEW
3
import logging
×
NEW
4
from pathlib import Path
×
NEW
5
from typing import Tuple
×
6

NEW
7
import click
×
8

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

NEW
13
LOG = logging.getLogger(__name__)
×
14

15

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

20

NEW
21
@validation.command("create-validation-case")
×
NEW
22
@click.option(
×
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
)
NEW
28
@click.option(
×
29
    "-cn",
30
    "--case-name",
31
    required=True,
32
    help="Case name that is used as name for the validation case.",
33
)
NEW
34
@click.option(
×
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
)
NEW
40
@click.option(
×
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
)
NEW
46
@DRY_RUN
×
NEW
47
@click.pass_obj
×
NEW
48
def create_validation_case(
×
49
    context: CGConfig, case_id: str, case_name: str, delivery: str, data_analysis: str
50
):
51
    """Create a validation case to be used in workflow validation."""
NEW
52
    validation_case_api = CreateValidationCaseAPI(
×
53
        status_db=context.status_db, housekeeper_api=context.housekeeper_api
54
    )
55

NEW
56
    try:
×
NEW
57
        validation_case_api.create_validation_case(
×
58
            case_id=case_id, case_name=case_name, delivery=delivery, data_analysis=data_analysis
59
        )
NEW
60
    except Exception as error:
×
NEW
61
        LOG.error(f"An error occured {repr(error)}.")
×
NEW
62
        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