opentf-toolkit-nightly 0.62.0.dev1373__py3-none-any.whl → 0.62.0.dev1377__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.
- opentf/commons/__init__.py +2 -2
- opentf/commons/config.py +3 -3
- opentf/scripts/startup.py +1 -1
- opentf/toolkit/__init__.py +3 -3
- opentf/toolkit/channels.py +23 -1
- opentf/toolkit/core.py +4 -2
- {opentf_toolkit_nightly-0.62.0.dev1373.dist-info → opentf_toolkit_nightly-0.62.0.dev1377.dist-info}/METADATA +1 -1
- {opentf_toolkit_nightly-0.62.0.dev1373.dist-info → opentf_toolkit_nightly-0.62.0.dev1377.dist-info}/RECORD +11 -11
- {opentf_toolkit_nightly-0.62.0.dev1373.dist-info → opentf_toolkit_nightly-0.62.0.dev1377.dist-info}/WHEEL +0 -0
- {opentf_toolkit_nightly-0.62.0.dev1373.dist-info → opentf_toolkit_nightly-0.62.0.dev1377.dist-info}/licenses/LICENSE +0 -0
- {opentf_toolkit_nightly-0.62.0.dev1373.dist-info → opentf_toolkit_nightly-0.62.0.dev1377.dist-info}/top_level.txt +0 -0
opentf/commons/__init__.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
"""Helpers for the OpenTestFactory orchestrator services."""
|
|
16
16
|
|
|
17
|
-
from typing import Any, Dict, List, NoReturn, Optional,
|
|
17
|
+
from typing import Any, Dict, List, NoReturn, Optional, Union
|
|
18
18
|
|
|
19
19
|
import logging
|
|
20
20
|
import os
|
|
@@ -217,7 +217,7 @@ def _get_contextparameter_spec(app: Flask, name: str) -> Optional[Dict[str, Any]
|
|
|
217
217
|
app.logger.info('Configuration:')
|
|
218
218
|
parameters = app.config[PARAMETERS_KEY]
|
|
219
219
|
try:
|
|
220
|
-
spec = get_named(
|
|
220
|
+
spec = get_named(parameters, name)
|
|
221
221
|
if spec.get('type') == 'int':
|
|
222
222
|
spec['type'] = 'number'
|
|
223
223
|
if spec.get('type') == 'bool':
|
opentf/commons/config.py
CHANGED
|
@@ -226,7 +226,7 @@ def read_config(
|
|
|
226
226
|
|
|
227
227
|
context_name = altcontext or config['current-context']
|
|
228
228
|
try:
|
|
229
|
-
context = get_named(
|
|
229
|
+
context = get_named(config['contexts'], context_name)['context']
|
|
230
230
|
except ValueError as err:
|
|
231
231
|
raise ConfigError(f'Could not find context "{context_name}": {err}.')
|
|
232
232
|
return context, config
|
|
@@ -278,7 +278,7 @@ def read_descriptor(
|
|
|
278
278
|
raise ConfigError(f'Could not get descriptor "{filename}", aborting: {err}.')
|
|
279
279
|
|
|
280
280
|
|
|
281
|
-
def get_named(
|
|
281
|
+
def get_named(entries: List[Dict[str, Any]], name: str) -> Dict[str, Any]:
|
|
282
282
|
"""Get an entry from a list of dictionaries.
|
|
283
283
|
|
|
284
284
|
Matching entries are those with a 'name' entry equal to the
|
|
@@ -286,8 +286,8 @@ def get_named(name: str, entries: List[Dict[str, Any]]) -> Dict[str, Any]:
|
|
|
286
286
|
|
|
287
287
|
# Required parameters
|
|
288
288
|
|
|
289
|
-
- name: a string, the entry 'name'
|
|
290
289
|
- entries: a list of dictionaries
|
|
290
|
+
- name: a string, the entry 'name'
|
|
291
291
|
|
|
292
292
|
# Returned value
|
|
293
293
|
|
opentf/scripts/startup.py
CHANGED
|
@@ -394,7 +394,7 @@ def start_plugins(conf: Dict[str, Any]) -> List[Any]:
|
|
|
394
394
|
else:
|
|
395
395
|
disabled = []
|
|
396
396
|
if (v := _get_env('OPENTF_ALLURE_ENABLED')) is None or (
|
|
397
|
-
v.lower() not in ('true', 'yes', 'on')
|
|
397
|
+
v.lower() not in ('true', 'yes', 'on', '1')
|
|
398
398
|
):
|
|
399
399
|
disabled.append('allure.collector')
|
|
400
400
|
disabled.append('result.aggregator')
|
opentf/toolkit/__init__.py
CHANGED
|
@@ -14,11 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
"""A toolkit for creating OpenTestFactory plugins."""
|
|
16
16
|
|
|
17
|
-
from typing import Any, Callable, Dict,
|
|
17
|
+
from typing import Any, Callable, Dict, Optional
|
|
18
18
|
|
|
19
19
|
import os
|
|
20
20
|
import threading
|
|
21
|
-
import sys
|
|
22
21
|
|
|
23
22
|
from collections import defaultdict
|
|
24
23
|
from time import sleep
|
|
@@ -553,7 +552,8 @@ def make_plugin(
|
|
|
553
552
|
|
|
554
553
|
- name: a string
|
|
555
554
|
- description: a string
|
|
556
|
-
- `channel`, `generator` or `
|
|
555
|
+
- `channel`, `generator`, `provider`, `providers`, or `publisher`: a
|
|
556
|
+
function
|
|
557
557
|
- providers: a dictionary
|
|
558
558
|
|
|
559
559
|
# Optional parameters
|
opentf/toolkit/channels.py
CHANGED
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
"""Toolkit helpers for channels plugins."""
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
|
18
|
+
from typing import Any, Callable, Dict, List, NamedTuple, Optional, Set, Tuple, Union
|
|
19
19
|
|
|
20
|
+
from datetime import datetime
|
|
20
21
|
from shlex import quote
|
|
21
22
|
|
|
22
23
|
import fnmatch
|
|
@@ -137,6 +138,27 @@ OPENTF_VARIABLES_REGEX = re.compile(r'^(export|set)\s(\"?.+)$')
|
|
|
137
138
|
OPENTF_VARIABLES_NAME_REGEX = re.compile(r'^[a-zA-Z0-9_]+$')
|
|
138
139
|
|
|
139
140
|
|
|
141
|
+
## Lease helpers
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class Offer(NamedTuple):
|
|
145
|
+
"""An offer for a job."""
|
|
146
|
+
|
|
147
|
+
job_id: str
|
|
148
|
+
metadata: Dict[str, Any]
|
|
149
|
+
candidates: List[str]
|
|
150
|
+
tags: Set[str]
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class Lease(NamedTuple):
|
|
154
|
+
"""A lease for a job."""
|
|
155
|
+
|
|
156
|
+
job_id: str
|
|
157
|
+
expire: datetime
|
|
158
|
+
offer: Dict[str, Any]
|
|
159
|
+
tags: Set[str]
|
|
160
|
+
|
|
161
|
+
|
|
140
162
|
## Variables helpers
|
|
141
163
|
|
|
142
164
|
|
opentf/toolkit/core.py
CHANGED
|
@@ -283,10 +283,12 @@ def validate_params_inputs(inputs: Dict[str, Any]):
|
|
|
283
283
|
format_ = inputs['format']
|
|
284
284
|
|
|
285
285
|
if format_ != SQUASHTM_FORMAT:
|
|
286
|
-
fail('Unknown format value for params.')
|
|
286
|
+
fail('Unknown "format" value for params.')
|
|
287
287
|
|
|
288
288
|
if data.keys() - {'global', 'test'}:
|
|
289
|
-
fail(
|
|
289
|
+
fail(
|
|
290
|
+
'Unexpected keys found in data, was only expecting "global" and/or "test".'
|
|
291
|
+
)
|
|
290
292
|
|
|
291
293
|
|
|
292
294
|
def attach_file(path: str, **kwargs) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opentf-toolkit-nightly
|
|
3
|
-
Version: 0.62.0.
|
|
3
|
+
Version: 0.62.0.dev1377
|
|
4
4
|
Summary: OpenTestFactory Orchestrator Toolkit
|
|
5
5
|
Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
|
|
6
6
|
Author: Martin Lafaix
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
opentf/commons/__init__.py,sha256=
|
|
1
|
+
opentf/commons/__init__.py,sha256=arFXmrY-ViO8htpI53s2kz4sGNawutTjFPn0jNsfx8Y,23004
|
|
2
2
|
opentf/commons/auth.py,sha256=yUmAoZPk9Aru2UVT5xSjH96u9DOKPk17AeL1_12mjBM,16399
|
|
3
|
-
opentf/commons/config.py,sha256=
|
|
3
|
+
opentf/commons/config.py,sha256=r84DKgZNr50Wgwv2iBmDY3nNIS-7Dq2JtliR9btTGts,10454
|
|
4
4
|
opentf/commons/exceptions.py,sha256=7dhUXO8iyAbqVwlUKxZhgRzGqVcb7LkG39hFlm-VxIA,2407
|
|
5
5
|
opentf/commons/expressions.py,sha256=jM_YKXVOFhvOE2aE2IuacuvxhIsOYTFs2oQkpcbWR6g,19645
|
|
6
6
|
opentf/commons/meta.py,sha256=ygSO3mE2d-Ux62abzK1wYk86noT4R5Tumd90nyZo0MU,3322
|
|
@@ -56,12 +56,12 @@ opentf/schemas/opentestfactory.org/v1beta1/ServiceConfig.json,sha256=m5ZgWAKbutu
|
|
|
56
56
|
opentf/schemas/opentestfactory.org/v1beta1/Workflow.json,sha256=QZ8mM9PhzsI9gTmwmKTWYNoRn--rtcM3L0PzgnPBfMU,15424
|
|
57
57
|
opentf/schemas/opentestfactory.org/v1beta2/ServiceConfig.json,sha256=rEvK2YWL5lG94_qYgR_GnLWNsaQhaQ-2kuZdWJr5NnY,3517
|
|
58
58
|
opentf/scripts/launch_java_service.sh,sha256=S0jAaCuv2sZy0Gf2NGBuPX-eD531rcM-b0fNyhmzSjw,2423
|
|
59
|
-
opentf/scripts/startup.py,sha256=
|
|
60
|
-
opentf/toolkit/__init__.py,sha256=
|
|
61
|
-
opentf/toolkit/channels.py,sha256=
|
|
62
|
-
opentf/toolkit/core.py,sha256=
|
|
63
|
-
opentf_toolkit_nightly-0.62.0.
|
|
64
|
-
opentf_toolkit_nightly-0.62.0.
|
|
65
|
-
opentf_toolkit_nightly-0.62.0.
|
|
66
|
-
opentf_toolkit_nightly-0.62.0.
|
|
67
|
-
opentf_toolkit_nightly-0.62.0.
|
|
59
|
+
opentf/scripts/startup.py,sha256=K-uW-70EJb4Ou2dBFR_7utDU3oMWBczkomtikq_2qCc,23119
|
|
60
|
+
opentf/toolkit/__init__.py,sha256=YnH66dmePAIU7dq_xWFYTIEUrsL9qV9f82LRDiBzbzs,22057
|
|
61
|
+
opentf/toolkit/channels.py,sha256=oXZzW5bwcnGbJ7WAIkV42ekFnOQq7HxIvnyvURWaoNs,25904
|
|
62
|
+
opentf/toolkit/core.py,sha256=jMBDIYZ8Qn3BvsysfKoG0iTtjOnZsggetpH3eXygCsI,9636
|
|
63
|
+
opentf_toolkit_nightly-0.62.0.dev1377.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
64
|
+
opentf_toolkit_nightly-0.62.0.dev1377.dist-info/METADATA,sha256=5dQzMTM0rdKWHz-STjkmX5dkt0wq5x_t58JXy2ApaM0,2214
|
|
65
|
+
opentf_toolkit_nightly-0.62.0.dev1377.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
66
|
+
opentf_toolkit_nightly-0.62.0.dev1377.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
|
|
67
|
+
opentf_toolkit_nightly-0.62.0.dev1377.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|