opentf-toolkit-nightly 0.62.0.dev1314__py3-none-any.whl → 0.62.0.dev1320__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.
@@ -839,6 +839,8 @@ def validate_inputs(
839
839
 
840
840
  Non-normalized inputs are removed from the dictionary.
841
841
 
842
+ Choices values are validated. Types are not checked.
843
+
842
844
  # Required parameters
843
845
 
844
846
  - declaration: a dictionary
@@ -866,13 +868,19 @@ def validate_inputs(
866
868
  if definition.get('required', False):
867
869
  raise ValueError(f'Mandatory input "{key}" not provided.')
868
870
  _set_default(inputs, key, definition)
871
+ if definition.get('type') == 'choice':
872
+ if inputs.get(key) not in definition['options']:
873
+ allowed = '", "'.join(sorted(definition['options']))
874
+ raise ValueError(
875
+ f'Invalid value "{inputs.get(key)}" for input "{key}". Allowed values: "{allowed}".'
876
+ )
869
877
 
870
878
  if additional_inputs:
871
879
  return
872
880
 
873
881
  for key in inputs:
874
882
  if key not in declaration and key.replace('_', '-') not in declaration:
875
- allowed = ', '.join(sorted([f'"{k}"' for k in declaration.keys()]))
883
+ allowed = '", "'.join(sorted(declaration))
876
884
  raise ValueError(
877
- f'Unexpected input "{key}" found. Allowed inputs: {allowed}.'
885
+ f'Unexpected input "{key}" found. Allowed inputs: "{allowed}".'
878
886
  )
@@ -554,6 +554,21 @@
554
554
  "default": {
555
555
  "type": "string"
556
556
  },
557
+ "type": {
558
+ "enum": [
559
+ "string",
560
+ "number",
561
+ "boolean",
562
+ "choice"
563
+ ]
564
+ },
565
+ "options": {
566
+ "type": "array",
567
+ "items": {
568
+ "type": "string"
569
+ },
570
+ "minItems": 1
571
+ },
557
572
  "depreciationMessage": {
558
573
  "type": "string"
559
574
  }
@@ -561,6 +576,29 @@
561
576
  "required": [
562
577
  "description"
563
578
  ],
579
+ "if": {
580
+ "properties": {
581
+ "type": {
582
+ "const": "choice"
583
+ }
584
+ },
585
+ "required": [
586
+ "type"
587
+ ]
588
+
589
+ },
590
+ "then": {
591
+ "required": [
592
+ "options"
593
+ ]
594
+ },
595
+ "else": {
596
+ "not": {
597
+ "required": [
598
+ "options"
599
+ ]
600
+ }
601
+ },
564
602
  "additionalProperties": false
565
603
  }
566
604
  },
@@ -50,69 +50,16 @@
50
50
  "type": "object",
51
51
  "properties": {
52
52
  "worker": {
53
- "type": "object",
54
- "properties": {
55
- "worker_id": {
56
- "type": "string"
57
- },
58
- "status": {
59
- "type": "string",
60
- "enum": [
61
- "setup",
62
- "teardown"
63
- ]
64
- }
65
- },
66
- "additionalProperties": false,
67
- "required": [
68
- "worker_id",
69
- "status"
70
- ]
53
+ "$ref": "#/definitions/worker"
54
+ },
55
+ "channelHandler": {
56
+ "$ref": "#/definitions/channelHandler"
71
57
  },
72
58
  "testResults": {
73
- "type": "array",
74
- "items": {
75
- "type": "object",
76
- "properties": {
77
- "id": {
78
- "type": "string"
79
- },
80
- "name": {
81
- "type": "string"
82
- },
83
- "status": {
84
- "type": "string",
85
- "enum": [
86
- "SUCCESS",
87
- "FAILURE",
88
- "ERROR"
89
- ]
90
- }
91
- }
92
- }
59
+ "$ref": "#/definitions/testResults"
93
60
  },
94
61
  "managedTestResult": {
95
- "type": "object",
96
- "properties": {
97
- "reportStatus": {
98
- "type": "string"
99
- },
100
- "stepStatuses": {
101
- "type": "object"
102
- },
103
- "failureDetails": {
104
- "type": "array",
105
- "items": {
106
- "type": "string"
107
- }
108
- },
109
- "duration": {
110
- "type": "integer"
111
- }
112
- },
113
- "required": [
114
- "reportStatus"
115
- ]
62
+ "$ref": "#/definitions/managedTestResult"
116
63
  },
117
64
  "logs": {
118
65
  "type": "array",
@@ -145,5 +92,166 @@
145
92
  "metadata",
146
93
  "spec"
147
94
  ],
148
- "additionalProperties": false
95
+ "additionalProperties": false,
96
+ "definitions": {
97
+ "worker": {
98
+ "type": "object",
99
+ "properties": {
100
+ "worker_id": {
101
+ "type": "string"
102
+ },
103
+ "status": {
104
+ "type": "string",
105
+ "enum": [
106
+ "setup",
107
+ "teardown"
108
+ ]
109
+ }
110
+ },
111
+ "additionalProperties": false,
112
+ "required": [
113
+ "worker_id",
114
+ "status"
115
+ ]
116
+ },
117
+ "testResults": {
118
+ "type": "array",
119
+ "items": {
120
+ "type": "object",
121
+ "properties": {
122
+ "id": {
123
+ "type": "string"
124
+ },
125
+ "name": {
126
+ "type": "string"
127
+ },
128
+ "status": {
129
+ "type": "string",
130
+ "enum": [
131
+ "SUCCESS",
132
+ "FAILURE",
133
+ "ERROR"
134
+ ]
135
+ }
136
+ }
137
+ }
138
+ },
139
+ "managedTestResult": {
140
+ "type": "object",
141
+ "properties": {
142
+ "reportStatus": {
143
+ "type": "string"
144
+ },
145
+ "stepStatuses": {
146
+ "type": "object"
147
+ },
148
+ "failureDetails": {
149
+ "type": "array",
150
+ "items": {
151
+ "type": "string"
152
+ }
153
+ },
154
+ "duration": {
155
+ "type": "integer"
156
+ }
157
+ },
158
+ "required": [
159
+ "reportStatus"
160
+ ]
161
+ },
162
+ "channelHandler": {
163
+ "type": "object",
164
+ "properties": {
165
+ "channelhandler_id": {
166
+ "type": "string"
167
+ },
168
+ "channels": {
169
+ "type": "array",
170
+ "items": {
171
+ "type": "object",
172
+ "properties": {
173
+ "apiVersion": {
174
+ "type": "string"
175
+ },
176
+ "kind": {
177
+ "const": "Channel"
178
+ },
179
+ "metadata": {
180
+ "type": "object",
181
+ "properties": {
182
+ "name": {
183
+ "type": "string"
184
+ },
185
+ "namespaces": {
186
+ "type": "string"
187
+ }
188
+ },
189
+ "additionalProperties": true,
190
+ "required": [
191
+ "name",
192
+ "namespaces"
193
+ ]
194
+ },
195
+ "spec": {
196
+ "type": "object",
197
+ "properties": {
198
+ "tags": {
199
+ "type": "array",
200
+ "items": {
201
+ "type": "string"
202
+ },
203
+ "minItems": 1
204
+ }
205
+ },
206
+ "additionalProperties": false,
207
+ "required": [
208
+ "tags"
209
+ ]
210
+ },
211
+ "status": {
212
+ "type": "object",
213
+ "properties": {
214
+ "phase": {
215
+ "type": [
216
+ "string",
217
+ "null"
218
+ ],
219
+ "enum": [
220
+ "BUSY",
221
+ "IDLE",
222
+ "PENDING",
223
+ "UNREACHABLE",
224
+ null
225
+ ]
226
+ },
227
+ "currentJobID": {
228
+ "type": [
229
+ "string",
230
+ "null"
231
+ ]
232
+ }
233
+ },
234
+ "additionalProperties": false,
235
+ "required": [
236
+ "phase"
237
+ ]
238
+ }
239
+ }
240
+ },
241
+ "minItems": 0,
242
+ "additionalProperties": false,
243
+ "required": [
244
+ "metadata",
245
+ "spec",
246
+ "status"
247
+ ]
248
+ }
249
+ },
250
+ "additionalProperties": false,
251
+ "required": [
252
+ "channelhandler_id",
253
+ "channels"
254
+ ]
255
+ }
256
+ }
149
257
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: opentf-toolkit-nightly
3
- Version: 0.62.0.dev1314
3
+ Version: 0.62.0.dev1320
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,4 +1,4 @@
1
- opentf/commons/__init__.py,sha256=HvqRbKN7QbHrL4eSNp3q7hdf1OEo4-qvTzwVH_nx5js,26712
1
+ opentf/commons/__init__.py,sha256=965jZDUnSWT8h6Bw283JgNp5mkxzEM0KMkoIwijWXAw,27083
2
2
  opentf/commons/auth.py,sha256=gXRp_0Tf3bfd65F4QiQmh6C6vR9y3ugag_0DSvozJFk,15898
3
3
  opentf/commons/config.py,sha256=RVSSdQhMle4oCo_z_AR2EQ4U6sUjSxw-qVBtjKuJVfo,10219
4
4
  opentf/commons/exceptions.py,sha256=7dhUXO8iyAbqVwlUKxZhgRzGqVcb7LkG39hFlm-VxIA,2407
@@ -14,7 +14,7 @@ opentf/schemas/opentestfactory.org/v1/GeneratorResult.json,sha256=sOwieyDWi6UZR7
14
14
  opentf/schemas/opentestfactory.org/v1/ProviderCommand.json,sha256=EU4kvEKxlqpH2IkLZ1HdBealuG6C0YzPkAtI7dNrfHg,4427
15
15
  opentf/schemas/opentestfactory.org/v1/ProviderResult.json,sha256=Ej4zhCE3rCqCGKcaeAoIHwSJTV_7fw-rAxhJ52qA-Gs,9641
16
16
  opentf/schemas/opentestfactory.org/v1/Subscription.json,sha256=hNaCUW3qSqqa1LY01Ao7kQ8FJhkjkwMrrPf4xihgSt4,7150
17
- opentf/schemas/opentestfactory.org/v1/Workflow.json,sha256=WAFvCAIxmp22-AN1wPuOkd3BYs8UP5u3hj74NnlO3vU,22945
17
+ opentf/schemas/opentestfactory.org/v1/Workflow.json,sha256=17EE3VgrjSe_nOufJ2UZbgWbOSnK8Yu4TxIoJjGEkF4,24229
18
18
  opentf/schemas/opentestfactory.org/v1/WorkflowCanceled.json,sha256=BCWxnm3rt4VWh9GXkIhdNY9JYohFWxi9Wg3JjXIavaU,1694
19
19
  opentf/schemas/opentestfactory.org/v1/WorkflowCancellation.json,sha256=HAtc8xjrr-WwXwIck9B86BrHELkCb1oPYhTsRzHMMOE,1993
20
20
  opentf/schemas/opentestfactory.org/v1/WorkflowCompleted.json,sha256=KtC9-oeaBNM3D60SFpmYnLMtqewUAGRoOJfVzb7CdHg,1635
@@ -28,7 +28,7 @@ opentf/schemas/opentestfactory.org/v1alpha1/ExecutionResult.json,sha256=UeWc4TfR
28
28
  opentf/schemas/opentestfactory.org/v1alpha1/GeneratorCommand.json,sha256=uxbqDhP4newgz-85TnGKbchx448QEQ8WB5PXpcJy2ME,1754
29
29
  opentf/schemas/opentestfactory.org/v1alpha1/GeneratorResult.json,sha256=LkHLGt2uam1Q5Ux0zP_O9oFgxBMCjD3Th3BsfsXxd1g,6633
30
30
  opentf/schemas/opentestfactory.org/v1alpha1/InsightCollector.json,sha256=mPYt6vuRlW2nq_hOHP1ssk1vXiaOKugzMwRiPm3FzTw,17940
31
- opentf/schemas/opentestfactory.org/v1alpha1/Notification.json,sha256=MFPIS3l9nKHsvcpNl3yRwrsQJJ99OsfAFMFXxXJcaRs,4612
31
+ opentf/schemas/opentestfactory.org/v1alpha1/Notification.json,sha256=yx2_JJSTSAP9NVe_dxwc-0Y1StMcEqcqAJohztG5PsQ,8437
32
32
  opentf/schemas/opentestfactory.org/v1alpha1/PluginMetadata.json,sha256=BLklO7CObT4OpAEsQT60WJ1ttOcG71hIYzgN-e7Ch9k,2803
33
33
  opentf/schemas/opentestfactory.org/v1alpha1/ProviderCommand.json,sha256=soe0imdnnq1mfGEpcLJvF3JVUIrF-7FFECc7CzNzobI,2875
34
34
  opentf/schemas/opentestfactory.org/v1alpha1/ProviderConfig.json,sha256=HT0bgPJ5fNytQJr-wxU21oApp4RrjogurgRP-zj_eDs,3878
@@ -58,8 +58,8 @@ opentf/scripts/startup.py,sha256=AcVXU2auPvqMb_6OpGzkVqrpgYV6vz7x_Rnv8YbAEkk,231
58
58
  opentf/toolkit/__init__.py,sha256=xh0XggCuR4jumiYDeMGaklktMmV8_9HAb6K5z1oJzdU,22327
59
59
  opentf/toolkit/channels.py,sha256=6qKSsAgq_oJpuDRiKqVUz-EAjdfikcCG3SFAGmKZdhQ,25551
60
60
  opentf/toolkit/core.py,sha256=fqnGgaYnuVcd4fyeNIwpc0QtyUo7jsKeVgdkBfY3iqo,9443
61
- opentf_toolkit_nightly-0.62.0.dev1314.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
62
- opentf_toolkit_nightly-0.62.0.dev1314.dist-info/METADATA,sha256=etoJFQqPh2TUGlC4gVXkQuuQnNsu5T0vAprH_Io98Y8,2192
63
- opentf_toolkit_nightly-0.62.0.dev1314.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
64
- opentf_toolkit_nightly-0.62.0.dev1314.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
65
- opentf_toolkit_nightly-0.62.0.dev1314.dist-info/RECORD,,
61
+ opentf_toolkit_nightly-0.62.0.dev1320.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
62
+ opentf_toolkit_nightly-0.62.0.dev1320.dist-info/METADATA,sha256=49cXuerktzDHW7qDiNoOTrYTaHdHI6IwMPypvVr1IcM,2192
63
+ opentf_toolkit_nightly-0.62.0.dev1320.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
64
+ opentf_toolkit_nightly-0.62.0.dev1320.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
65
+ opentf_toolkit_nightly-0.62.0.dev1320.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (76.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5