argus-alm 0.12.4b2__py3-none-any.whl → 0.12.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- argus/backend/controller/client_api.py +11 -0
- argus/backend/controller/testrun_api.py +11 -0
- argus/backend/models/result.py +41 -0
- argus/backend/models/web.py +4 -0
- argus/backend/plugins/core.py +4 -2
- argus/backend/plugins/driver_matrix_tests/controller.py +0 -39
- argus/backend/plugins/driver_matrix_tests/model.py +2 -248
- argus/backend/plugins/driver_matrix_tests/raw_types.py +0 -27
- argus/backend/plugins/driver_matrix_tests/service.py +0 -18
- argus/backend/plugins/driver_matrix_tests/udt.py +13 -14
- argus/backend/plugins/sct/testrun.py +7 -0
- argus/backend/service/client_service.py +18 -0
- argus/backend/service/testrun.py +19 -0
- argus/client/base.py +16 -0
- argus/client/driver_matrix_tests/client.py +193 -56
- argus/client/generic_result.py +99 -0
- argus/client/generic_result_old.py +143 -0
- {argus_alm-0.12.4b2.dist-info → argus_alm-0.12.5.dist-info}/METADATA +1 -1
- {argus_alm-0.12.4b2.dist-info → argus_alm-0.12.5.dist-info}/RECORD +22 -20
- {argus_alm-0.12.4b2.dist-info → argus_alm-0.12.5.dist-info}/entry_points.txt +0 -1
- argus/client/driver_matrix_tests/cli.py +0 -110
- {argus_alm-0.12.4b2.dist-info → argus_alm-0.12.5.dist-info}/LICENSE +0 -0
- {argus_alm-0.12.4b2.dist-info → argus_alm-0.12.5.dist-info}/WHEEL +0 -0
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import base64
|
|
2
|
-
import json
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
import click
|
|
5
|
-
import logging
|
|
6
|
-
from argus.backend.util.enums import TestStatus
|
|
7
|
-
|
|
8
|
-
from argus.client.driver_matrix_tests.client import ArgusDriverMatrixClient
|
|
9
|
-
|
|
10
|
-
LOGGER = logging.getLogger(__name__)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@click.group
|
|
14
|
-
def cli():
|
|
15
|
-
pass
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def _submit_driver_result_internal(api_key: str, base_url: str, run_id: str, metadata_path: str):
|
|
19
|
-
metadata = json.loads(Path(metadata_path).read_text(encoding="utf-8"))
|
|
20
|
-
LOGGER.info("Submitting results for %s [%s/%s] to Argus...", run_id, metadata["driver_name"], metadata["driver_type"])
|
|
21
|
-
raw_xml = (Path(metadata_path).parent / metadata["junit_result"]).read_bytes()
|
|
22
|
-
client = ArgusDriverMatrixClient(run_id=run_id, auth_token=api_key, base_url=base_url)
|
|
23
|
-
client.submit_driver_result(driver_name=metadata["driver_name"], driver_type=metadata["driver_type"], raw_junit_data=base64.encodebytes(raw_xml))
|
|
24
|
-
LOGGER.info("Done.")
|
|
25
|
-
|
|
26
|
-
def _submit_driver_failure_internal(api_key: str, base_url: str, run_id: str, metadata_path: str):
|
|
27
|
-
metadata = json.loads(Path(metadata_path).read_text(encoding="utf-8"))
|
|
28
|
-
LOGGER.info("Submitting failure for %s [%s/%s] to Argus...", run_id, metadata["driver_name"], metadata["driver_type"])
|
|
29
|
-
client = ArgusDriverMatrixClient(run_id=run_id, auth_token=api_key, base_url=base_url)
|
|
30
|
-
client.submit_driver_failure(driver_name=metadata["driver_name"], driver_type=metadata["driver_type"], failure_reason=metadata["failure_reason"])
|
|
31
|
-
LOGGER.info("Done.")
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
@click.command("submit-run")
|
|
35
|
-
@click.option("--api-key", help="Argus API key for authorization", required=True)
|
|
36
|
-
@click.option("--base-url", default="https://argus.scylladb.com", help="Base URL for argus instance")
|
|
37
|
-
@click.option("--id", "run_id", required=True, help="UUID (v4 or v1) unique to the job")
|
|
38
|
-
@click.option("--build-id", required=True, help="Unique job identifier in the build system, e.g. scylla-master/group/job for jenkins (The full path)")
|
|
39
|
-
@click.option("--build-url", required=True, help="Job URL in the build system")
|
|
40
|
-
def submit_driver_matrix_run(api_key: str, base_url: str, run_id: str, build_id: str, build_url: str):
|
|
41
|
-
LOGGER.info("Submitting %s (%s) to Argus...", build_id, run_id)
|
|
42
|
-
client = ArgusDriverMatrixClient(run_id=run_id, auth_token=api_key, base_url=base_url)
|
|
43
|
-
client.submit_driver_matrix_run(job_name=build_id, job_url=build_url)
|
|
44
|
-
LOGGER.info("Done.")
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
@click.command("submit-driver")
|
|
48
|
-
@click.option("--api-key", help="Argus API key for authorization", required=True)
|
|
49
|
-
@click.option("--base-url", default="https://argus.scylladb.com", help="Base URL for argus instance")
|
|
50
|
-
@click.option("--id", "run_id", required=True, help="UUID (v4 or v1) unique to the job")
|
|
51
|
-
@click.option("--metadata-path", required=True, help="Path to the metadata .json file that contains path to junit xml and other required information")
|
|
52
|
-
def submit_driver_result(api_key: str, base_url: str, run_id: str, metadata_path: str):
|
|
53
|
-
_submit_driver_result_internal(api_key=api_key, base_url=base_url, run_id=run_id, metadata_path=metadata_path)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
@click.command("fail-driver")
|
|
57
|
-
@click.option("--api-key", help="Argus API key for authorization", required=True)
|
|
58
|
-
@click.option("--base-url", default="https://argus.scylladb.com", help="Base URL for argus instance")
|
|
59
|
-
@click.option("--id", "run_id", required=True, help="UUID (v4 or v1) unique to the job")
|
|
60
|
-
@click.option("--metadata-path", required=True, help="Path to the metadata .json file that contains path to junit xml and other required information")
|
|
61
|
-
def submit_driver_failure(api_key: str, base_url: str, run_id: str, metadata_path: str):
|
|
62
|
-
_submit_driver_failure_internal(api_key=api_key, base_url=base_url, run_id=run_id, metadata_path=metadata_path)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
@click.command("submit-or-fail-driver")
|
|
66
|
-
@click.option("--api-key", help="Argus API key for authorization", required=True)
|
|
67
|
-
@click.option("--base-url", default="https://argus.scylladb.com", help="Base URL for argus instance")
|
|
68
|
-
@click.option("--id", "run_id", required=True, help="UUID (v4 or v1) unique to the job")
|
|
69
|
-
@click.option("--metadata-path", required=True, help="Path to the metadata .json file that contains path to junit xml and other required information")
|
|
70
|
-
def submit_or_fail_driver(api_key: str, base_url: str, run_id: str, metadata_path: str):
|
|
71
|
-
metadata = json.loads(Path(metadata_path).read_text(encoding="utf-8"))
|
|
72
|
-
if metadata.get("failure_reason"):
|
|
73
|
-
_submit_driver_failure_internal(api_key=api_key, base_url=base_url, run_id=run_id, metadata_path=metadata_path)
|
|
74
|
-
else:
|
|
75
|
-
_submit_driver_result_internal(api_key=api_key, base_url=base_url, run_id=run_id, metadata_path=metadata_path)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
@click.command("submit-env")
|
|
79
|
-
@click.option("--api-key", help="Argus API key for authorization", required=True)
|
|
80
|
-
@click.option("--base-url", default="https://argus.scylladb.com", help="Base URL for argus instance")
|
|
81
|
-
@click.option("--id", "run_id", required=True, help="UUID (v4 or v1) unique to the job")
|
|
82
|
-
@click.option("--env-path", required=True, help="Path to the Build-00.txt file that contains environment information about Scylla")
|
|
83
|
-
def submit_driver_env(api_key: str, base_url: str, run_id: str, env_path: str):
|
|
84
|
-
LOGGER.info("Submitting environment for run %s to Argus...", run_id)
|
|
85
|
-
raw_env = Path(env_path).read_text()
|
|
86
|
-
client = ArgusDriverMatrixClient(run_id=run_id, auth_token=api_key, base_url=base_url)
|
|
87
|
-
client.submit_env(raw_env)
|
|
88
|
-
LOGGER.info("Done.")
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
@click.command("finish-run")
|
|
92
|
-
@click.option("--api-key", help="Argus API key for authorization", required=True)
|
|
93
|
-
@click.option("--base-url", default="https://argus.scylladb.com", help="Base URL for argus instance")
|
|
94
|
-
@click.option("--id", "run_id", required=True, help="UUID (v4 or v1) unique to the job")
|
|
95
|
-
@click.option("--status", required=True, help="Resulting job status")
|
|
96
|
-
def finish_driver_matrix_run(api_key: str, base_url: str, run_id: str, status: str):
|
|
97
|
-
client = ArgusDriverMatrixClient(run_id=run_id, auth_token=api_key, base_url=base_url)
|
|
98
|
-
client.finalize_run(run_type=ArgusDriverMatrixClient.test_type, run_id=run_id, body={"status": TestStatus(status)})
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
cli.add_command(submit_driver_matrix_run)
|
|
102
|
-
cli.add_command(submit_driver_result)
|
|
103
|
-
cli.add_command(submit_or_fail_driver)
|
|
104
|
-
cli.add_command(submit_driver_failure)
|
|
105
|
-
cli.add_command(submit_driver_env)
|
|
106
|
-
cli.add_command(finish_driver_matrix_run)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if __name__ == "__main__":
|
|
110
|
-
cli()
|
|
File without changes
|
|
File without changes
|