argus-alm 0.15.6__py3-none-any.whl → 0.15.8__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/_version.py +2 -2
- argus/client/base.py +5 -8
- argus/client/sct/client.py +21 -0
- argus/common/email.py +33 -0
- argus/common/enums.py +1 -0
- {argus_alm-0.15.6.dist-info → argus_alm-0.15.8.dist-info}/METADATA +6 -1
- {argus_alm-0.15.6.dist-info → argus_alm-0.15.8.dist-info}/RECORD +11 -10
- {argus_alm-0.15.6.dist-info → argus_alm-0.15.8.dist-info}/WHEEL +0 -0
- {argus_alm-0.15.6.dist-info → argus_alm-0.15.8.dist-info}/entry_points.txt +0 -0
- {argus_alm-0.15.6.dist-info → argus_alm-0.15.8.dist-info}/licenses/LICENSE +0 -0
- {argus_alm-0.15.6.dist-info → argus_alm-0.15.8.dist-info}/top_level.txt +0 -0
argus/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.15.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 15,
|
|
31
|
+
__version__ = version = '0.15.8'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 15, 8)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
argus/client/base.py
CHANGED
|
@@ -37,16 +37,14 @@ class ArgusClient:
|
|
|
37
37
|
self._auth_token = auth_token
|
|
38
38
|
self._base_url = base_url
|
|
39
39
|
self._api_ver = api_version
|
|
40
|
-
self.
|
|
40
|
+
self.session = requests.Session()
|
|
41
|
+
if extra_headers:
|
|
42
|
+
self.session.headers.update(extra_headers)
|
|
41
43
|
|
|
42
44
|
@property
|
|
43
45
|
def auth_token(self) -> str:
|
|
44
46
|
return self._auth_token
|
|
45
47
|
|
|
46
|
-
@property
|
|
47
|
-
def extra_headers(self) -> dict:
|
|
48
|
-
return self._extra_headers
|
|
49
|
-
|
|
50
48
|
def verify_location_params(self, endpoint: str, location_params: dict[str, str]) -> bool:
|
|
51
49
|
required_params: list[str] = re.findall(r"\$[\w_]+", endpoint)
|
|
52
50
|
for param in required_params:
|
|
@@ -92,7 +90,6 @@ class ArgusClient:
|
|
|
92
90
|
"Authorization": f"token {self.auth_token}",
|
|
93
91
|
"Accept": "application/json",
|
|
94
92
|
"Content-Type": "application/json",
|
|
95
|
-
**self.extra_headers,
|
|
96
93
|
}
|
|
97
94
|
|
|
98
95
|
def get(self, endpoint: str, location_params: dict[str, str] = None, params: dict = None) -> requests.Response:
|
|
@@ -101,7 +98,7 @@ class ArgusClient:
|
|
|
101
98
|
location_params=location_params
|
|
102
99
|
)
|
|
103
100
|
LOGGER.debug("GET Request: %s, params: %s", url, params)
|
|
104
|
-
response =
|
|
101
|
+
response = self.session.get(
|
|
105
102
|
url=url,
|
|
106
103
|
params=params,
|
|
107
104
|
headers=self.request_headers
|
|
@@ -122,7 +119,7 @@ class ArgusClient:
|
|
|
122
119
|
location_params=location_params
|
|
123
120
|
)
|
|
124
121
|
LOGGER.debug("POST Request: %s, params: %s, body: %s", url, params, body)
|
|
125
|
-
response =
|
|
122
|
+
response = self.session.post(
|
|
126
123
|
url=url,
|
|
127
124
|
params=params,
|
|
128
125
|
json=body,
|
argus/client/sct/client.py
CHANGED
|
@@ -2,6 +2,7 @@ import base64
|
|
|
2
2
|
from typing import Any
|
|
3
3
|
from uuid import UUID
|
|
4
4
|
from dataclasses import asdict
|
|
5
|
+
from argus.common.email import RawAttachment, ReportSection, ReportSectionShortHand
|
|
5
6
|
from argus.common.sct_types import GeminiResultsRequest, PerformanceResultsRequest, RawEventPayload
|
|
6
7
|
from argus.common.enums import ResourceState, TestStatus
|
|
7
8
|
from argus.client.base import ArgusClient
|
|
@@ -27,6 +28,7 @@ class ArgusSCTClient(ArgusClient):
|
|
|
27
28
|
SUBMIT_EVENTS = "/sct/$id/events/submit"
|
|
28
29
|
SUBMIT_EVENT = "/sct/$id/event/submit"
|
|
29
30
|
SUBMIT_JUNIT_REPORT = "/sct/$id/junit/submit"
|
|
31
|
+
SUBMIT_EMAIL = "/testrun/report"
|
|
30
32
|
|
|
31
33
|
def __init__(self, run_id: UUID, auth_token: str, base_url: str, api_version="v1", extra_headers: dict | None = None) -> None:
|
|
32
34
|
super().__init__(auth_token, base_url, api_version, extra_headers=extra_headers)
|
|
@@ -136,6 +138,25 @@ class ArgusSCTClient(ArgusClient):
|
|
|
136
138
|
)
|
|
137
139
|
self.check_response(response)
|
|
138
140
|
|
|
141
|
+
def send_email(self, recipients: list[str], title: str = "#auto", sections: list[ReportSection | ReportSectionShortHand] = None, attachments: list[RawAttachment] | None = None) -> None:
|
|
142
|
+
"""
|
|
143
|
+
Send a testrun report email using Argus.
|
|
144
|
+
Documentation: https://github.com/scylladb/argus/blob/master/docs/api_usage.md#L124
|
|
145
|
+
"""
|
|
146
|
+
response = self.post(
|
|
147
|
+
endpoint=self.Routes.SUBMIT_EMAIL,
|
|
148
|
+
location_params={},
|
|
149
|
+
body={
|
|
150
|
+
**self.generic_body,
|
|
151
|
+
"run_id": self.run_id,
|
|
152
|
+
"title": title,
|
|
153
|
+
"recipients": recipients,
|
|
154
|
+
"sections": sections or [],
|
|
155
|
+
"attachments": attachments or [],
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
self.check_response(response)
|
|
159
|
+
|
|
139
160
|
def submit_gemini_results(self, gemini_data: GeminiResultsRequest) -> None:
|
|
140
161
|
"""
|
|
141
162
|
Submits gemini results such as oracle node information and gemini command & its results
|
argus/common/email.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
from typing import Any, Literal, TypedDict
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class ReportSection(TypedDict):
|
|
6
|
+
type: str
|
|
7
|
+
options: dict[str, Any]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
ReportSectionShortHand = Literal["main",
|
|
11
|
+
"header",
|
|
12
|
+
"packages",
|
|
13
|
+
"logs",
|
|
14
|
+
"cloud",
|
|
15
|
+
"nemesis",
|
|
16
|
+
"events",
|
|
17
|
+
"screenshots",
|
|
18
|
+
"custom_table",
|
|
19
|
+
"custom_html",]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class RawAttachment(TypedDict):
|
|
23
|
+
filename: str
|
|
24
|
+
data: str # Base64 string
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class RawReportSendRequest(TypedDict):
|
|
28
|
+
schema_version: str
|
|
29
|
+
run_id: str
|
|
30
|
+
title: str
|
|
31
|
+
recipients: list[str]
|
|
32
|
+
sections: list[ReportSection]
|
|
33
|
+
attachments: list[RawAttachment]
|
argus/common/enums.py
CHANGED
|
@@ -39,6 +39,7 @@ class PytestStatus(str, Enum):
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class TestInvestigationStatus(str, Enum):
|
|
42
|
+
__test__ = False # prevent pytest from collecting this Enum as a test class
|
|
42
43
|
NOT_INVESTIGATED = "not_investigated"
|
|
43
44
|
IN_PROGRESS = "in_progress"
|
|
44
45
|
INVESTIGATED = "investigated"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: argus-alm
|
|
3
|
-
Version: 0.15.
|
|
3
|
+
Version: 0.15.8
|
|
4
4
|
Summary: Argus
|
|
5
5
|
Author-email: Alexey Kartashov <alexey.kartashov@scylladb.com>, Łukasz Sójka <lukasz.sojka@scylladb.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -24,6 +24,7 @@ Requires-Dist: python-jenkins>=1.7.0; extra == "web-backend"
|
|
|
24
24
|
Requires-Dist: python-slugify~=6.1.1; extra == "web-backend"
|
|
25
25
|
Requires-Dist: pygithub>=2.6.1; extra == "web-backend"
|
|
26
26
|
Requires-Dist: boto3~=1.38.9; extra == "web-backend"
|
|
27
|
+
Requires-Dist: prometheus-flask-exporter>=0.23.2; extra == "web-backend"
|
|
27
28
|
Provides-Extra: docker-image
|
|
28
29
|
Requires-Dist: supervisor~=4.2.4; extra == "docker-image"
|
|
29
30
|
Provides-Extra: dev
|
|
@@ -50,6 +51,10 @@ Dynamic: license-file
|
|
|
50
51
|
|
|
51
52
|
Argus is a test tracking system intended to provide observability into automated test pipelines which use long-running resources. It allows observation of a test status, its events and its allocated resources. It also allows easy comparison between particular runs of a specific test.
|
|
52
53
|
|
|
54
|
+
## Contributing
|
|
55
|
+
|
|
56
|
+
Review the [Repository Guidelines](AGENTS.md) for project structure, tooling expectations, and pull request practices before submitting changes.
|
|
57
|
+
|
|
53
58
|
## Installation notes
|
|
54
59
|
|
|
55
60
|
### Development
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
argus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
argus/_version.py,sha256=
|
|
2
|
+
argus/_version.py,sha256=OZz2ObefAkpiEMaFTa9SJuKISgl89HYDOVrF-rvuYh8,706
|
|
3
3
|
argus/client/__init__.py,sha256=bO9_j5_jK5kvTHR46KEZ0Y-p0li7CBW8QSd-K5Ez4vA,42
|
|
4
|
-
argus/client/base.py,sha256=
|
|
4
|
+
argus/client/base.py,sha256=FZ9-quDXwViWbz892XnuZlWJiAmzpnTgvkRXV9i8HlE,8423
|
|
5
5
|
argus/client/generic_result.py,sha256=9D0zrpfEDiIL7PjL12TZnqk5Mi_1T1UvesF5wWeMfz0,6264
|
|
6
6
|
argus/client/driver_matrix_tests/cli.py,sha256=JpI0v1hzRQr9KkrxO7D4hEbkzumexFFC_iRM8558zHU,8375
|
|
7
7
|
argus/client/driver_matrix_tests/client.py,sha256=fFucqwog6WnDnje1xB-4ERfwHXblXP4upmtt9RtOkls,2806
|
|
8
8
|
argus/client/generic/cli.py,sha256=jsdSwzwzefX1POyrZ4lFTRcjWPmTauuXBGjceM54Zk4,4707
|
|
9
9
|
argus/client/generic/client.py,sha256=3MONtLIcF7rZ5x5OaAQKi4YGHCHb3-9ooCUhWtKs4C4,1971
|
|
10
|
-
argus/client/sct/client.py,sha256=
|
|
10
|
+
argus/client/sct/client.py,sha256=3qn_2ioFEleg8XzZWXFvythTIpCwMPvLzXMBxf57fR8,12866
|
|
11
11
|
argus/client/sct/types.py,sha256=VLgVe7qPmJtCLqtPnuX8N8kMKZq-iY3SKz68nvU6nJ4,371
|
|
12
12
|
argus/client/sirenada/client.py,sha256=lzhmBFAUnvPSAJfCjeQ0L5nbp50Q0YLHwIondO9rvt4,6321
|
|
13
13
|
argus/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
argus/common/
|
|
14
|
+
argus/common/email.py,sha256=YUgin4yA3-1bH6HbtXIh09SLAzYSzSJPKM9sIvroAMA,842
|
|
15
|
+
argus/common/enums.py,sha256=FM308aseXxsaeOqoiyM-NIDWKHpbceLysd-sLDh7TkI,1287
|
|
15
16
|
argus/common/sct_types.py,sha256=GX0S1_eH3eBOO17WqBVtsDKzz86vgL2VUM7gi9Cjrmc,1649
|
|
16
17
|
argus/common/sirenada_types.py,sha256=CZH2JXA1KYUj29eXYe8rIAAWdN1XPqOsDPAXvM25bVQ,698
|
|
17
|
-
argus_alm-0.15.
|
|
18
|
-
argus_alm-0.15.
|
|
19
|
-
argus_alm-0.15.
|
|
20
|
-
argus_alm-0.15.
|
|
21
|
-
argus_alm-0.15.
|
|
22
|
-
argus_alm-0.15.
|
|
18
|
+
argus_alm-0.15.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
19
|
+
argus_alm-0.15.8.dist-info/METADATA,sha256=fn-TaUp-ZELmGImVprz5aQxhcvm-vTPd9o9I9ZYF1bI,5098
|
|
20
|
+
argus_alm-0.15.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
21
|
+
argus_alm-0.15.8.dist-info/entry_points.txt,sha256=5mSBLLPndhFHKY5M9SCF8WhDBAArrj-S2IL-uoiaJiE,140
|
|
22
|
+
argus_alm-0.15.8.dist-info/top_level.txt,sha256=Pea173vTU-Et8xmNCctS34REW4cH0Xmjyiztu0HuM0c,6
|
|
23
|
+
argus_alm-0.15.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|