opentf-toolkit-nightly 0.55.0.dev970__py3-none-any.whl → 0.55.0.dev977__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.
@@ -126,7 +126,9 @@ def _has_testresult(item: Dict[str, Any]) -> bool:
126
126
 
127
127
 
128
128
  def _get_workflow_jobs(events: List[Dict[str, Any]]) -> Dict[str, Any]:
129
- """yada
129
+ """Get workflow jobs that have steps.
130
+
131
+ TOTO Will have to be reviewed when adding nested generators.
130
132
 
131
133
  # Required parameters
132
134
 
@@ -136,14 +138,32 @@ def _get_workflow_jobs(events: List[Dict[str, Any]]) -> Dict[str, Any]:
136
138
 
137
139
  A dictionary. Keys are job names, values are a (dict, event) pair.
138
140
 
139
- _event_ is either a workflow or a generatorresult event.
141
+ - name: a string, the job's name and the generator's job_id, if any
142
+ - job: a dictionary (its `runs-on` entry is a list of strings)
143
+ - event: either a workflow or a generatorresult event.
140
144
  """
141
- return {
142
- job_name + ' ' + event['metadata'].get('job_id', ''): (job, event)
145
+
146
+ def _clean(j):
147
+ j['runs-on'] = _as_list(j.get('runs-on', []))
148
+ return j
149
+
150
+ jobs = {
151
+ job_name + ' ' + event['metadata'].get('job_id', ''): (_clean(job), event)
143
152
  for event in filter(lambda x: x['kind'] in (WORKFLOW, GENERATORRESULT), events)
144
153
  for job_name, job in event.get('jobs', {}).items()
145
- if job.get('steps')
146
154
  }
155
+ for job_name, (job, event) in jobs.items():
156
+ if ' ' not in job_name.strip():
157
+ # we do not have to patch top-level jobs
158
+ continue
159
+ if not event['metadata']['job_origin']:
160
+ job['runs-on'] = list(
161
+ set(
162
+ job['runs-on'] + jobs[event['metadata']['name'] + ' '][0]['runs-on']
163
+ )
164
+ )
165
+
166
+ return {name: (job, event) for name, (job, event) in jobs.items() if 'steps' in job}
147
167
 
148
168
 
149
169
  def _uses_inception(events: List[Dict[str, Any]]) -> bool:
@@ -307,7 +327,7 @@ def _create_testresult_labels(
307
327
  'test': {
308
328
  'job': job_name.split()[0],
309
329
  'managed': False,
310
- 'runs-on': _as_list(job['runs-on']),
330
+ 'runs-on': job['runs-on'],
311
331
  'technology': exec_step['uses'].partition('/')[0],
312
332
  'test': exec_step.get('with', {}).get('test'),
313
333
  'uses': exec_step['uses'],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: opentf-toolkit-nightly
3
- Version: 0.55.0.dev970
3
+ Version: 0.55.0.dev977
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,7 +1,7 @@
1
1
  opentf/commons/__init__.py,sha256=KRY8ShQw_0ZZ0oEOiKi4-xnWofE_QsFjEe1T8wUxJ-w,21952
2
2
  opentf/commons/auth.py,sha256=bM2Z3kxm2Wku1lKXaRAIg37LHvXWAXIZIqjplDfN2P8,15899
3
3
  opentf/commons/config.py,sha256=GmvInVnUsXIwlNfgTQeQ_pPs97GeGTGn2S2QZEFwss8,7828
4
- opentf/commons/datasources.py,sha256=8qWC6KFiFGiIOEH7FGdbP_4hd_gVJFxbpR-051rhNZI,24452
4
+ opentf/commons/datasources.py,sha256=So0G1AURM7ceo93qom6Gfs73BW0924vmgcrt9iOrPZs,25224
5
5
  opentf/commons/expressions.py,sha256=A68F27Our8oVVphUrRvB5haSlqj2YCrH2OxHPNLBio4,19251
6
6
  opentf/commons/pubsub.py,sha256=7khxAHVZiwJRcwIBJ6MPR-f3xY9144-2eNLROwq5F-4,5894
7
7
  opentf/commons/schemas.py,sha256=lokZCU-wmsIkzVA-TVENtC7Io_GmYxrP-FQaOOowg4s,4044
@@ -48,8 +48,8 @@ opentf/scripts/startup.py,sha256=Da2zo93pBWbdRmj-wgekgLcF94rpNc3ZkbvR8R0w8XY,212
48
48
  opentf/toolkit/__init__.py,sha256=g3DiTZlSvvzZWKgM8qU47muLqjQrpWZ6M6PWZ-sBsvQ,19610
49
49
  opentf/toolkit/channels.py,sha256=Cng3b4LUsxvCHUbp_skys9CFcKZMfcKhA_ODg_EAlIE,17156
50
50
  opentf/toolkit/core.py,sha256=L1fT4YzwZjqE7PUXhJL6jSVQge3ohBQv5UBb9DAC6oo,9320
51
- opentf_toolkit_nightly-0.55.0.dev970.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
52
- opentf_toolkit_nightly-0.55.0.dev970.dist-info/METADATA,sha256=HtsZubZUG9Sh90pvArtKrIISBBZIqzv3dvsbuCvpoLI,1945
53
- opentf_toolkit_nightly-0.55.0.dev970.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
54
- opentf_toolkit_nightly-0.55.0.dev970.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
55
- opentf_toolkit_nightly-0.55.0.dev970.dist-info/RECORD,,
51
+ opentf_toolkit_nightly-0.55.0.dev977.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
52
+ opentf_toolkit_nightly-0.55.0.dev977.dist-info/METADATA,sha256=xWNgjta0vy0dCbRpvpu0ACKezcKCX6FCsEEItu_guZo,1945
53
+ opentf_toolkit_nightly-0.55.0.dev977.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
54
+ opentf_toolkit_nightly-0.55.0.dev977.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
55
+ opentf_toolkit_nightly-0.55.0.dev977.dist-info/RECORD,,