orangebeard-client 2.6.0__tar.gz → 2.7.0__tar.gz
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.
- {orangebeard_client-2.6.0/orangebeard_client.egg-info → orangebeard_client-2.7.0}/PKG-INFO +2 -2
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/Cli.py +6 -2
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/OrangebeardClient.py +5 -1
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/config/AutoConfig.py +26 -11
- orangebeard_client-2.7.0/orangebeard/entity/Attribute.py +11 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/OrangebeardParameters.py +3 -3
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0/orangebeard_client.egg-info}/PKG-INFO +2 -2
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/pyproject.toml +1 -1
- orangebeard_client-2.6.0/orangebeard/entity/Attribute.py +0 -9
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/LICENSE +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/__init__.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/Attachment.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/FinishStep.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/FinishTest.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/FinishTestRun.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/Log.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/LogFormat.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/LogLevel.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/SUTComponent.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/Serializable.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/StartStep.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/StartSuite.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/StartTest.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/StartTestRun.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/Suite.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/TestStatus.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/TestType.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/__init__.py +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard_client.egg-info/SOURCES.txt +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard_client.egg-info/dependency_links.txt +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard_client.egg-info/entry_points.txt +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard_client.egg-info/requires.txt +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard_client.egg-info/top_level.txt +0 -0
- {orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: orangebeard-client
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.7.0
|
|
4
4
|
Summary: A python3 client for Orangebeard
|
|
5
5
|
Author-email: Tom Heintzberger <tom@orangebeard.io>
|
|
6
6
|
Project-URL: Homepage, https://github.com/orangebeard-io/python-client
|
|
@@ -22,8 +22,9 @@ def main():
|
|
|
22
22
|
parser.add_argument('-t', '--accessToken', help="Your Orangebeard Access Token", default=config.token)
|
|
23
23
|
parser.add_argument('-p', '--project', help="Orangebeard Project Name", default=config.project)
|
|
24
24
|
parser.add_argument('-x', '--cmd', required=True, choices=['start', 'finish'], help="Command to execute")
|
|
25
|
-
parser.add_argument('-s', '--testset', help="The testset name
|
|
25
|
+
parser.add_argument('-s', '--testset', help="The testset name", default=config.testset)
|
|
26
26
|
parser.add_argument('-d', '--description', help="The test run description", default=config.description)
|
|
27
|
+
parser.add_argument('-a', '--attributes', help="Test run attributes", default=None)
|
|
27
28
|
parser.add_argument('-id', '--testRunUuid', help="The UUID of the test run to finish, required for finish",
|
|
28
29
|
default=None)
|
|
29
30
|
|
|
@@ -35,10 +36,13 @@ def main():
|
|
|
35
36
|
config.testset = args.testset
|
|
36
37
|
config.description = args.description
|
|
37
38
|
|
|
39
|
+
if args.attributes is not None:
|
|
40
|
+
config.attributes = config.attributes.extend(AutoConfig.get_attributes_from_string(args.attributes))
|
|
41
|
+
|
|
38
42
|
client = OrangebeardClient(orangebeard_config=config)
|
|
39
43
|
|
|
40
44
|
if args.cmd == "start":
|
|
41
|
-
temp_uuid = client.start_test_run(StartTestRun(config.testset, datetime.now(tz), config.description), True)
|
|
45
|
+
temp_uuid = client.start_test_run(StartTestRun(config.testset, datetime.now(tz), config.description, config.attributes), True)
|
|
42
46
|
asyncio.gather(client.call_events[temp_uuid].wait())
|
|
43
47
|
print(client.uuid_mapping[temp_uuid])
|
|
44
48
|
sys.exit(0)
|
|
@@ -59,6 +59,10 @@ class OrangebeardClient:
|
|
|
59
59
|
access_token (UUID): The access token for authentication.
|
|
60
60
|
project_name (str): The name of the Orangebeard project.
|
|
61
61
|
"""
|
|
62
|
+
if orangebeard_config is not None:
|
|
63
|
+
endpoint = orangebeard_config.endpoint if endpoint is None else endpoint
|
|
64
|
+
access_token = orangebeard_config.token if access_token is None else access_token
|
|
65
|
+
project_name = orangebeard_config.project if project_name is None else project_name
|
|
62
66
|
|
|
63
67
|
if endpoint is None or access_token is None or project_name is None:
|
|
64
68
|
if orangebeard_config is not None:
|
|
@@ -82,7 +86,7 @@ class OrangebeardClient:
|
|
|
82
86
|
self.__event_loop = asyncio.new_event_loop()
|
|
83
87
|
asyncio.set_event_loop(self.__event_loop)
|
|
84
88
|
|
|
85
|
-
if orangebeard_config.testrun_uuid is not None:
|
|
89
|
+
if orangebeard_config is not None and orangebeard_config.testrun_uuid is not None:
|
|
86
90
|
self.__external_run_lifecycle = True
|
|
87
91
|
self.__call_events[orangebeard_config.testrun_uuid] = asyncio.Event()
|
|
88
92
|
self.__uuid_mapping[orangebeard_config.testrun_uuid] = orangebeard_config.testrun_uuid
|
|
@@ -7,8 +7,17 @@ from orangebeard.entity.Attribute import Attribute
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def get_attributes_from_string(string_attr: str) -> List[Attribute]:
|
|
10
|
-
return [Attribute(*attribute.
|
|
11
|
-
string_attr.split(';')]
|
|
10
|
+
return [Attribute(*attribute.partition(':')[::2]) for attribute in
|
|
11
|
+
string_attr.split(';')] if string_attr is not None else []
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _create_attribute_objects(attributes_data: Optional[list]) -> List[Attribute]:
|
|
15
|
+
attributes = []
|
|
16
|
+
if attributes_data:
|
|
17
|
+
for item in attributes_data:
|
|
18
|
+
if isinstance(item, dict): # Handle JSON-style dictionaries
|
|
19
|
+
attributes.append(Attribute(item.get("key"), item.get("value")))
|
|
20
|
+
return attributes
|
|
12
21
|
|
|
13
22
|
|
|
14
23
|
def update_config_parameters_from_env(current_config: OrangebeardParameters) -> OrangebeardParameters:
|
|
@@ -17,10 +26,16 @@ def update_config_parameters_from_env(current_config: OrangebeardParameters) ->
|
|
|
17
26
|
current_config.testset = os.environ.get('ORANGEBEARD_TESTSET', current_config.testset)
|
|
18
27
|
current_config.project = os.environ.get('ORANGEBEARD_PROJECT', current_config.project)
|
|
19
28
|
current_config.description = os.environ.get('ORANGEBEARD_DESCRIPTION', current_config.description)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
|
|
30
|
+
current_config.attributes = _create_attribute_objects(current_config.attributes)
|
|
31
|
+
env_attributes = get_attributes_from_string(os.environ.get('ORANGEBEARD_ATTRIBUTES', None))
|
|
32
|
+
if env_attributes:
|
|
33
|
+
current_config.attributes.extend(env_attributes)
|
|
34
|
+
|
|
35
|
+
current_config.referenceUrl = os.environ.get('ORANGEBEARD_REF_URL', current_config.referenceUrl)
|
|
36
|
+
if current_config.referenceUrl is not None:
|
|
37
|
+
current_config.attributes.append(Attribute('reference_url', current_config.referenceUrl))
|
|
38
|
+
|
|
24
39
|
current_config.testrun_uuid = os.environ.get('ORANGEBEARD_TESTRUN_UUID', current_config.testrun_uuid)
|
|
25
40
|
|
|
26
41
|
return current_config
|
|
@@ -29,6 +44,7 @@ def update_config_parameters_from_env(current_config: OrangebeardParameters) ->
|
|
|
29
44
|
# noinspection PyBroadException
|
|
30
45
|
def get_config(path_to_resolve: str) -> Optional[OrangebeardParameters]:
|
|
31
46
|
traversing = True
|
|
47
|
+
configuration = OrangebeardParameters()
|
|
32
48
|
while traversing:
|
|
33
49
|
config_file_path = os.path.join(path_to_resolve, 'orangebeard.json')
|
|
34
50
|
if os.path.exists(config_file_path):
|
|
@@ -37,18 +53,17 @@ def get_config(path_to_resolve: str) -> Optional[OrangebeardParameters]:
|
|
|
37
53
|
config_data = json.load(file)
|
|
38
54
|
if not isinstance(config_data, dict):
|
|
39
55
|
config_data = None
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return update_config_parameters_from_env(config_from_file)
|
|
56
|
+
configuration.__dict__.update(config_data)
|
|
57
|
+
break
|
|
43
58
|
except Exception:
|
|
44
|
-
|
|
59
|
+
pass
|
|
45
60
|
|
|
46
61
|
prev_path = path_to_resolve
|
|
47
62
|
path_to_resolve = os.path.dirname(path_to_resolve)
|
|
48
63
|
|
|
49
64
|
traversing = path_to_resolve != prev_path
|
|
50
65
|
|
|
51
|
-
return update_config_parameters_from_env(
|
|
66
|
+
return update_config_parameters_from_env(configuration)
|
|
52
67
|
|
|
53
68
|
|
|
54
69
|
config = get_config(os.getcwd())
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from orangebeard.entity.Serializable import Serializable
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Attribute(Serializable):
|
|
5
|
+
def __init__(self, key=None, value=None):
|
|
6
|
+
if value is None: # If only one argument is passed, treat it as a value
|
|
7
|
+
self.key = None
|
|
8
|
+
self.value = key
|
|
9
|
+
else:
|
|
10
|
+
self.key = key
|
|
11
|
+
self.value = value
|
{orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard/entity/OrangebeardParameters.py
RENAMED
|
@@ -9,7 +9,7 @@ class OrangebeardParameters(Serializable):
|
|
|
9
9
|
project=None,
|
|
10
10
|
description=None,
|
|
11
11
|
attributes=None,
|
|
12
|
-
|
|
12
|
+
reference_url=None,
|
|
13
13
|
testrun_uuid=None
|
|
14
14
|
):
|
|
15
15
|
self.token = token
|
|
@@ -17,6 +17,6 @@ class OrangebeardParameters(Serializable):
|
|
|
17
17
|
self.testset = testset
|
|
18
18
|
self.project = project
|
|
19
19
|
self.description = description
|
|
20
|
-
self.attributes = attributes
|
|
21
|
-
self.
|
|
20
|
+
self.attributes = attributes or []
|
|
21
|
+
self.referenceUrl = reference_url
|
|
22
22
|
self.testrun_uuid = testrun_uuid
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: orangebeard-client
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.7.0
|
|
4
4
|
Summary: A python3 client for Orangebeard
|
|
5
5
|
Author-email: Tom Heintzberger <tom@orangebeard.io>
|
|
6
6
|
Project-URL: Homepage, https://github.com/orangebeard-io/python-client
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard_client.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard_client.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard_client.egg-info/requires.txt
RENAMED
|
File without changes
|
{orangebeard_client-2.6.0 → orangebeard_client-2.7.0}/orangebeard_client.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|