opentf-toolkit-nightly 0.56.0.dev1005__py3-none-any.whl → 0.56.0.dev1011__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/expressions.py +12 -17
- opentf/schemas/opentestfactory.org/v1/Workflow.json +21 -14
- {opentf_toolkit_nightly-0.56.0.dev1005.dist-info → opentf_toolkit_nightly-0.56.0.dev1011.dist-info}/METADATA +1 -1
- {opentf_toolkit_nightly-0.56.0.dev1005.dist-info → opentf_toolkit_nightly-0.56.0.dev1011.dist-info}/RECORD +7 -7
- {opentf_toolkit_nightly-0.56.0.dev1005.dist-info → opentf_toolkit_nightly-0.56.0.dev1011.dist-info}/LICENSE +0 -0
- {opentf_toolkit_nightly-0.56.0.dev1005.dist-info → opentf_toolkit_nightly-0.56.0.dev1011.dist-info}/WHEEL +0 -0
- {opentf_toolkit_nightly-0.56.0.dev1005.dist-info → opentf_toolkit_nightly-0.56.0.dev1011.dist-info}/top_level.txt +0 -0
opentf/commons/expressions.py
CHANGED
|
@@ -387,26 +387,14 @@ def evaluate_status_function(name: str, contexts) -> bool:
|
|
|
387
387
|
"""Evaluate job status function.
|
|
388
388
|
|
|
389
389
|
Annotates the contexts[SPECIAL_FUNCTIONS] entry with a `__called__`
|
|
390
|
-
sub-entry
|
|
391
|
-
usage.
|
|
390
|
+
sub-entry, so that caller can detect status function usage.
|
|
392
391
|
"""
|
|
393
|
-
|
|
392
|
+
funcs = contexts.get(SPECIAL_FUNCTIONS, {})
|
|
393
|
+
if name not in funcs:
|
|
394
394
|
raise ValueError(f'Unknown function {name}()')
|
|
395
395
|
# a status function has been used
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
if name == 'always':
|
|
399
|
-
return True
|
|
400
|
-
if external_functions := contexts.get(SPECIAL_FUNCTIONS):
|
|
401
|
-
if name in external_functions:
|
|
402
|
-
return external_functions[name]
|
|
403
|
-
raise ValueError(f'Unknown function {name}()')
|
|
404
|
-
if name == 'success':
|
|
405
|
-
return contexts['job']['status'] == 'success'
|
|
406
|
-
if name == 'failure':
|
|
407
|
-
return contexts['job']['status'] == 'failure'
|
|
408
|
-
if name == 'cancelled':
|
|
409
|
-
return contexts['job']['status'] == 'cancelled'
|
|
396
|
+
funcs['__called__'] = True
|
|
397
|
+
return funcs[name]
|
|
410
398
|
|
|
411
399
|
|
|
412
400
|
def _evaluate_identifier(
|
|
@@ -648,11 +636,18 @@ def evaluate_bool(expr: str, contexts, special_functions=None) -> bool:
|
|
|
648
636
|
|
|
649
637
|
`expr` may be surrounded by `${{` and `}}`.
|
|
650
638
|
|
|
639
|
+
`special_functions`, if provided, is a dictionary of function names
|
|
640
|
+
to bools.
|
|
641
|
+
|
|
651
642
|
# Required parameters
|
|
652
643
|
|
|
653
644
|
- expr: a string
|
|
654
645
|
- contexts: a dictionary
|
|
655
646
|
|
|
647
|
+
# Optional parameters
|
|
648
|
+
|
|
649
|
+
- special_functions: a dictionary or None (None by default)
|
|
650
|
+
|
|
656
651
|
# Returned value
|
|
657
652
|
|
|
658
653
|
A boolean.
|
|
@@ -531,22 +531,29 @@
|
|
|
531
531
|
"type": "object",
|
|
532
532
|
"patternProperties": {
|
|
533
533
|
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
|
|
534
|
-
"
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
"
|
|
534
|
+
"oneOf": [
|
|
535
|
+
{
|
|
536
|
+
"type": "object",
|
|
537
|
+
"properties": {
|
|
538
|
+
"description": {
|
|
539
|
+
"type": "string"
|
|
540
|
+
},
|
|
541
|
+
"value": {
|
|
542
|
+
"type": "string"
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"required": [
|
|
546
|
+
"value"
|
|
547
|
+
],
|
|
548
|
+
"additionalProperties": false
|
|
538
549
|
},
|
|
539
|
-
|
|
550
|
+
{
|
|
540
551
|
"type": "string"
|
|
541
552
|
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
"additionalProperties": false
|
|
547
|
-
}
|
|
548
|
-
},
|
|
549
|
-
"minProperties": 1
|
|
553
|
+
]
|
|
554
|
+
},
|
|
555
|
+
"minProperties": 1
|
|
556
|
+
}
|
|
550
557
|
},
|
|
551
558
|
"resources": {
|
|
552
559
|
"type": "object",
|
|
@@ -628,4 +635,4 @@
|
|
|
628
635
|
}
|
|
629
636
|
}
|
|
630
637
|
}
|
|
631
|
-
}
|
|
638
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opentf-toolkit-nightly
|
|
3
|
-
Version: 0.56.0.
|
|
3
|
+
Version: 0.56.0.dev1011
|
|
4
4
|
Summary: OpenTestFactory Orchestrator Toolkit
|
|
5
5
|
Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
|
|
6
6
|
Author: Martin Lafaix
|
|
@@ -2,13 +2,13 @@ opentf/commons/__init__.py,sha256=KRY8ShQw_0ZZ0oEOiKi4-xnWofE_QsFjEe1T8wUxJ-w,21
|
|
|
2
2
|
opentf/commons/auth.py,sha256=bM2Z3kxm2Wku1lKXaRAIg37LHvXWAXIZIqjplDfN2P8,15899
|
|
3
3
|
opentf/commons/config.py,sha256=GmvInVnUsXIwlNfgTQeQ_pPs97GeGTGn2S2QZEFwss8,7828
|
|
4
4
|
opentf/commons/datasources.py,sha256=4ye-TMtaE88O8GVcWx-FtKXOC8aIZLteR6wfIr7Do8U,25232
|
|
5
|
-
opentf/commons/expressions.py,sha256=
|
|
5
|
+
opentf/commons/expressions.py,sha256=jM_YKXVOFhvOE2aE2IuacuvxhIsOYTFs2oQkpcbWR6g,19645
|
|
6
6
|
opentf/commons/pubsub.py,sha256=7khxAHVZiwJRcwIBJ6MPR-f3xY9144-2eNLROwq5F-4,5894
|
|
7
7
|
opentf/commons/schemas.py,sha256=YSCvlmqc7satt-OqIoYXnmhOyo9h8wIpNyKaBAY4u9c,4039
|
|
8
8
|
opentf/commons/selectors.py,sha256=DEpLgRAr5HXSpSYI4liXP2hLUTvOSexFa9Vfa1xIQTk,7134
|
|
9
9
|
opentf/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
opentf/schemas/abac.opentestfactory.org/v1alpha1/Policy.json,sha256=JXsfNAPSEYggeyaDutSQBeG38o4Bmcr70dPLWWeqIh8,2105
|
|
11
|
-
opentf/schemas/opentestfactory.org/v1/Workflow.json,sha256=
|
|
11
|
+
opentf/schemas/opentestfactory.org/v1/Workflow.json,sha256=CBMVP_6xD3Iffep9db0R_-i3kV7f5Lk_tjPOljyjrmw,21769
|
|
12
12
|
opentf/schemas/opentestfactory.org/v1alpha1/AgentRegistration.json,sha256=NQykqU-lKE8LtBhBiFUcpVJq00MRG6dZsoM1xedx6uQ,1230
|
|
13
13
|
opentf/schemas/opentestfactory.org/v1alpha1/AllureCollectorOutput.json,sha256=-L9DDWA0A4x54bPMn4m6Qwi2tf2nHvzIPFOElTjaVck,1366
|
|
14
14
|
opentf/schemas/opentestfactory.org/v1alpha1/ChannelHandlerHooks.json,sha256=6K6m9praw_f2biCMHfTsHPYia5z2jq10dciRLqf3ogI,1239
|
|
@@ -49,8 +49,8 @@ opentf/scripts/startup.py,sha256=Da2zo93pBWbdRmj-wgekgLcF94rpNc3ZkbvR8R0w8XY,212
|
|
|
49
49
|
opentf/toolkit/__init__.py,sha256=icNo_jz2IfhwddunQpfq6F-0xeKS70S-0Or5zJliEZs,21692
|
|
50
50
|
opentf/toolkit/channels.py,sha256=6xcVKHUK2FdyVKIQmPQbakngfVuQDzCcD_lInOdKpro,17171
|
|
51
51
|
opentf/toolkit/core.py,sha256=MvvWUrS4dvo3Qrd_Yl9uND3CllL0qtMi-y1S-Na1uQs,9621
|
|
52
|
-
opentf_toolkit_nightly-0.56.0.
|
|
53
|
-
opentf_toolkit_nightly-0.56.0.
|
|
54
|
-
opentf_toolkit_nightly-0.56.0.
|
|
55
|
-
opentf_toolkit_nightly-0.56.0.
|
|
56
|
-
opentf_toolkit_nightly-0.56.0.
|
|
52
|
+
opentf_toolkit_nightly-0.56.0.dev1011.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
53
|
+
opentf_toolkit_nightly-0.56.0.dev1011.dist-info/METADATA,sha256=9MI2DUIbZhJadrqfmuHfsqeVRaCxrUreUM7Pedu2_iA,1946
|
|
54
|
+
opentf_toolkit_nightly-0.56.0.dev1011.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
55
|
+
opentf_toolkit_nightly-0.56.0.dev1011.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
|
|
56
|
+
opentf_toolkit_nightly-0.56.0.dev1011.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|