argus-alm 0.13.0__py3-none-any.whl → 0.13.1__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/client/generic/cli.py +20 -0
- argus/client/generic/client.py +22 -0
- argus/client/generic_result.py +3 -3
- argus/client/sct/client.py +2 -1
- {argus_alm-0.13.0.dist-info → argus_alm-0.13.1.dist-info}/METADATA +1 -1
- {argus_alm-0.13.0.dist-info → argus_alm-0.13.1.dist-info}/RECORD +9 -9
- {argus_alm-0.13.0.dist-info → argus_alm-0.13.1.dist-info}/LICENSE +0 -0
- {argus_alm-0.13.0.dist-info → argus_alm-0.13.1.dist-info}/WHEEL +0 -0
- {argus_alm-0.13.0.dist-info → argus_alm-0.13.1.dist-info}/entry_points.txt +0 -0
argus/client/generic/cli.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from pathlib import Path
|
|
1
3
|
import click
|
|
2
4
|
import logging
|
|
3
5
|
|
|
@@ -39,8 +41,26 @@ def finish_run(api_key: str, base_url: str, id: str, status: str, scylla_version
|
|
|
39
41
|
client.finalize_generic_run(run_id=id, status=status, scylla_version=scylla_version)
|
|
40
42
|
|
|
41
43
|
|
|
44
|
+
@click.command("trigger-jobs")
|
|
45
|
+
@click.option("--api-key", help="Argus API key for authorization", required=True)
|
|
46
|
+
@click.option("--base-url", default="https://argus.scylladb.com", help="Base URL for argus instance")
|
|
47
|
+
@click.option("--version", help="Scylla version to filter plans by", default=None, required=False)
|
|
48
|
+
@click.option("--plan-id", help="Specific plan id for filtering", default=None, required=False)
|
|
49
|
+
@click.option("--release", help="Release name to filter plans by", default=None, required=False)
|
|
50
|
+
@click.option("--job-info-file", required=True, help="JSON file with trigger information (see detailed docs)")
|
|
51
|
+
def trigger_jobs(api_key: str, base_url: str, job_info_file: str, version: str, plan_id: str, release: str):
|
|
52
|
+
client = ArgusGenericClient(auth_token=api_key, base_url=base_url)
|
|
53
|
+
path = Path(job_info_file)
|
|
54
|
+
if not path.exists():
|
|
55
|
+
LOGGER.error("File not found: %s", job_info_file)
|
|
56
|
+
exit(128)
|
|
57
|
+
payload = json.load(path.open("rt", encoding="utf-8"))
|
|
58
|
+
client.trigger_jobs({ "release": release, "version": version, "plan_id": plan_id, **payload })
|
|
59
|
+
|
|
60
|
+
|
|
42
61
|
cli.add_command(submit_run)
|
|
43
62
|
cli.add_command(finish_run)
|
|
63
|
+
cli.add_command(trigger_jobs)
|
|
44
64
|
|
|
45
65
|
|
|
46
66
|
if __name__ == "__main__":
|
argus/client/generic/client.py
CHANGED
|
@@ -7,6 +7,10 @@ LOGGER = logging.getLogger(__name__)
|
|
|
7
7
|
class ArgusGenericClient(ArgusClient):
|
|
8
8
|
test_type = "generic"
|
|
9
9
|
schema_version: None = "v1"
|
|
10
|
+
|
|
11
|
+
class Routes(ArgusClient.Routes):
|
|
12
|
+
TRIGGER_JOBS = "/planning/plan/trigger"
|
|
13
|
+
|
|
10
14
|
def __init__(self, auth_token: str, base_url: str, api_version="v1") -> None:
|
|
11
15
|
super().__init__(auth_token, base_url, api_version)
|
|
12
16
|
|
|
@@ -22,6 +26,24 @@ class ArgusGenericClient(ArgusClient):
|
|
|
22
26
|
response = self.submit_run(run_type=self.test_type, run_body=request_body)
|
|
23
27
|
self.check_response(response)
|
|
24
28
|
|
|
29
|
+
def trigger_jobs(self, common_params: dict[str, str], params: list[dict[str, str]], version: str = None, release: str = None, plan_id: str = None):
|
|
30
|
+
request_body = {
|
|
31
|
+
"common_params": common_params,
|
|
32
|
+
"params": params,
|
|
33
|
+
"version": version,
|
|
34
|
+
"release": release,
|
|
35
|
+
"plan_id": plan_id,
|
|
36
|
+
}
|
|
37
|
+
response = self.post(
|
|
38
|
+
endpoint=self.Routes.TRIGGER_JOBS,
|
|
39
|
+
location_params={},
|
|
40
|
+
body={
|
|
41
|
+
**self.generic_body,
|
|
42
|
+
**request_body,
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
self.check_response(response)
|
|
46
|
+
return response.json()
|
|
25
47
|
|
|
26
48
|
def finalize_generic_run(self, run_id: str, status: str, scylla_version: str | None = None):
|
|
27
49
|
response = self.finalize_run(run_type=self.test_type, run_id=run_id, body={
|
argus/client/generic_result.py
CHANGED
|
@@ -62,6 +62,7 @@ class ResultTableMeta(type):
|
|
|
62
62
|
cls_instance.description = meta.description
|
|
63
63
|
cls_instance.columns = meta.Columns
|
|
64
64
|
cls_instance.column_types = {column.name: column.type for column in cls_instance.columns}
|
|
65
|
+
cls_instance.sut_package_name = getattr(meta, 'sut_package_name', '')
|
|
65
66
|
cls_instance.rows = []
|
|
66
67
|
validation_rules = getattr(meta, 'ValidationRules', {})
|
|
67
68
|
for col_name, rule in validation_rules.items():
|
|
@@ -98,7 +99,6 @@ class GenericResultTable(metaclass=ResultTableMeta):
|
|
|
98
99
|
Base class for all Generic Result Tables in Argus. Use it as a base class for your result table.
|
|
99
100
|
"""
|
|
100
101
|
sut_timestamp: int = 0 # automatic timestamp based on SUT version. Works only with SCT and refers to Scylla version.
|
|
101
|
-
sut_details: str = ""
|
|
102
102
|
results: list[Cell] = field(default_factory=list)
|
|
103
103
|
|
|
104
104
|
def as_dict(self) -> dict:
|
|
@@ -112,12 +112,12 @@ class GenericResultTable(metaclass=ResultTableMeta):
|
|
|
112
112
|
"description": self.description,
|
|
113
113
|
"columns_meta": [column.as_dict() for column in self.columns],
|
|
114
114
|
"rows_meta": rows,
|
|
115
|
-
"validation_rules": {k: v.as_dict() for k, v in self.validation_rules.items()}
|
|
115
|
+
"validation_rules": {k: v.as_dict() for k, v in self.validation_rules.items()},
|
|
116
|
+
"sut_package_name": self.sut_package_name,
|
|
116
117
|
}
|
|
117
118
|
return {
|
|
118
119
|
"meta": meta_info,
|
|
119
120
|
"sut_timestamp": self.sut_timestamp,
|
|
120
|
-
"sut_details": self.sut_details,
|
|
121
121
|
"results": [result.as_dict() for result in self.results]
|
|
122
122
|
}
|
|
123
123
|
|
argus/client/sct/client.py
CHANGED
|
@@ -56,7 +56,7 @@ class ArgusSCTClient(ArgusClient):
|
|
|
56
56
|
response = super().set_status(run_type=self.test_type, run_id=self.run_id, new_status=new_status)
|
|
57
57
|
self.check_response(response)
|
|
58
58
|
|
|
59
|
-
def set_sct_runner(self, public_ip: str, private_ip: str, region: str, backend: str) -> None:
|
|
59
|
+
def set_sct_runner(self, public_ip: str, private_ip: str, region: str, backend: str, name: str = None) -> None:
|
|
60
60
|
"""
|
|
61
61
|
Sets runner information for an SCT run.
|
|
62
62
|
"""
|
|
@@ -69,6 +69,7 @@ class ArgusSCTClient(ArgusClient):
|
|
|
69
69
|
"private_ip": private_ip,
|
|
70
70
|
"region": region,
|
|
71
71
|
"backend": backend,
|
|
72
|
+
"name": name,
|
|
72
73
|
}
|
|
73
74
|
)
|
|
74
75
|
self.check_response(response)
|
|
@@ -3,18 +3,18 @@ argus/client/__init__.py,sha256=bO9_j5_jK5kvTHR46KEZ0Y-p0li7CBW8QSd-K5Ez4vA,42
|
|
|
3
3
|
argus/client/base.py,sha256=SLOakgME2i49yZSgA59pH8dTdsXjl_nwuofDkP01p88,7988
|
|
4
4
|
argus/client/driver_matrix_tests/cli.py,sha256=6BMiesOd3f20giUk700OPSP6qvV9byD1Ti6zqG-DAeo,6341
|
|
5
5
|
argus/client/driver_matrix_tests/client.py,sha256=whhx3IYkXDWD6n5c9BjKEgSsG7OqmsWCnLIUeeoAmc4,2742
|
|
6
|
-
argus/client/generic/cli.py,sha256=
|
|
7
|
-
argus/client/generic/client.py,sha256=
|
|
8
|
-
argus/client/generic_result.py,sha256=
|
|
9
|
-
argus/client/sct/client.py,sha256=
|
|
6
|
+
argus/client/generic/cli.py,sha256=uZqS_gWc4uLfPndbO78ofUx8wLiY5f_bWRlQL6qBpNg,3360
|
|
7
|
+
argus/client/generic/client.py,sha256=bSpIdXpG_jY67-z4sg2BLO4ZxcZEJzQVmZV0H3pQ7SE,1849
|
|
8
|
+
argus/client/generic_result.py,sha256=tZe9IvbhCy-drk31t0FQwVL2EdkF5m8Iwkn4VHGmiK0,4324
|
|
9
|
+
argus/client/sct/client.py,sha256=Nnl0v-4O5I7JQqxBUN3qGMBGx_7jGQ4-HifRO0a_-cA,11375
|
|
10
10
|
argus/client/sct/types.py,sha256=VLgVe7qPmJtCLqtPnuX8N8kMKZq-iY3SKz68nvU6nJ4,371
|
|
11
11
|
argus/client/sirenada/client.py,sha256=8gLjJ-TDAi2pvHEhQ7m_zyHOLILu3JsknapF5tuUGXg,6211
|
|
12
12
|
argus/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
argus/common/enums.py,sha256=EhTQrgedlEz5sDYJ1gFnE2eC2nc1neQCRgzOgssQvWY,749
|
|
14
14
|
argus/common/sct_types.py,sha256=Gw1y4iqYguqNqTh_GopLDFho8vuGaOGuK7fjaHYhAOQ,1326
|
|
15
15
|
argus/common/sirenada_types.py,sha256=Gm3XMK9YJoozVaeM9XE7n8iRxA6PKBrS23Mo2vJfdLs,697
|
|
16
|
-
argus_alm-0.13.
|
|
17
|
-
argus_alm-0.13.
|
|
18
|
-
argus_alm-0.13.
|
|
19
|
-
argus_alm-0.13.
|
|
20
|
-
argus_alm-0.13.
|
|
16
|
+
argus_alm-0.13.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
+
argus_alm-0.13.1.dist-info/METADATA,sha256=msV017U_CdxRr-OmP0rZvVV_mqSJz8hRq3LMjzx8mtM,3406
|
|
18
|
+
argus_alm-0.13.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
19
|
+
argus_alm-0.13.1.dist-info/entry_points.txt,sha256=pcYW8nxZuDaymxE8tn86K0dq8eEodUdiS0sSvwEQ_zU,137
|
|
20
|
+
argus_alm-0.13.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|