-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathflaky_test_history.py
More file actions
78 lines (63 loc) · 2.65 KB
/
flaky_test_history.py
File metadata and controls
78 lines (63 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations
from typing import Union, TYPE_CHECKING
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)
if TYPE_CHECKING:
from datadog_api_client.v2.model.flaky_test_history_policy_id import FlakyTestHistoryPolicyId
from datadog_api_client.v2.model.flaky_test_history_policy_meta import FlakyTestHistoryPolicyMeta
class FlakyTestHistory(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.flaky_test_history_policy_id import FlakyTestHistoryPolicyId
from datadog_api_client.v2.model.flaky_test_history_policy_meta import FlakyTestHistoryPolicyMeta
return {
"commit_sha": (str,),
"policy_id": (FlakyTestHistoryPolicyId,),
"policy_meta": (FlakyTestHistoryPolicyMeta,),
"status": (str,),
"timestamp": (int,),
}
attribute_map = {
"commit_sha": "commit_sha",
"policy_id": "policy_id",
"policy_meta": "policy_meta",
"status": "status",
"timestamp": "timestamp",
}
def __init__(
self_,
commit_sha: str,
status: str,
timestamp: int,
policy_id: Union[FlakyTestHistoryPolicyId, UnsetType] = unset,
policy_meta: Union[FlakyTestHistoryPolicyMeta, UnsetType] = unset,
**kwargs,
):
"""
A single history entry representing a status change for a flaky test.
:param commit_sha: The commit SHA associated with this status change. Will be an empty string if the commit SHA is not available.
:type commit_sha: str
:param policy_id: The policy that triggered this status change.
:type policy_id: FlakyTestHistoryPolicyId, optional
:param policy_meta: Metadata about the policy that triggered this status change.
:type policy_meta: FlakyTestHistoryPolicyMeta, optional
:param status: The test status at this point in history.
:type status: str
:param timestamp: Unix timestamp in milliseconds when this status change occurred.
:type timestamp: int
"""
if policy_id is not unset:
kwargs["policy_id"] = policy_id
if policy_meta is not unset:
kwargs["policy_meta"] = policy_meta
super().__init__(kwargs)
self_.commit_sha = commit_sha
self_.status = status
self_.timestamp = timestamp