opentf-toolkit-nightly 0.59.0.dev1211__py3-none-any.whl → 0.59.0.dev1218__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.
@@ -323,6 +323,12 @@ def process_output(
323
323
  ) -> Dict[str, Any]:
324
324
  """Process output, filling structures.
325
325
 
326
+ `event` is expected to have its metadata enriched with the following
327
+ fields:
328
+
329
+ - channel_os: the runner OS
330
+ - channel_temp: the temporary directory on the runner
331
+
326
332
  # Required parameters
327
333
 
328
334
  - event: an ExecutionCommand event
@@ -330,7 +336,6 @@ def process_output(
330
336
  - stdout: a list of strings
331
337
  - stderr: a list of strings
332
338
  - jobstate: a JobState object
333
- - context: a dictionary, channelhandler context
334
339
  - _get: a function copying a remote file to a local path
335
340
  - _put: a function copying a local file to a remote environment
336
341
 
@@ -403,6 +408,8 @@ def process_output(
403
408
  if (params := _get_cmd_params(args, logs)) == 2:
404
409
  return 2
405
410
  filename, pattern = params.get('file'), params.get('pattern')
411
+ if not filename and not pattern:
412
+ pattern = '*'
406
413
  for artifact in artifacts:
407
414
  artifact_name = artifact.split('_')[-1]
408
415
  if filename and filename == artifact_name:
@@ -426,6 +433,9 @@ def process_output(
426
433
 
427
434
  metadata: Dict[str, Any] = event['metadata']
428
435
  is_windows: bool = metadata['channel_os'] == 'windows'
436
+ opentfvariables = VARIABLES_TEMPLATE[metadata['channel_os']].format(
437
+ job_id=metadata['job_id'], root=metadata['channel_temp']
438
+ )
429
439
  separator = '\\' if is_windows else '/'
430
440
  outputs = {}
431
441
  logs: List[str] = []
@@ -464,6 +474,9 @@ def process_output(
464
474
  if metadata.get('artifacts'):
465
475
  del metadata['artifacts']
466
476
 
477
+ if metadata['step_sequence_id'] != CHANNEL_RELEASE:
478
+ _attach(opentfvariables, f'type={OPENTF_VARIABLES_TYPE}')
479
+
467
480
  result = make_event(EXECUTIONRESULT, metadata=metadata, status=resp)
468
481
 
469
482
  if outputs:
@@ -478,17 +491,6 @@ def process_output(
478
491
  return result
479
492
 
480
493
 
481
- def _attach_opentf_variables(runner_os: str, script: List[str]):
482
- if runner_os == 'windows':
483
- script.append(
484
- f'@if exist "%OPENTF_VARIABLES%" echo ::attach type={OPENTF_VARIABLES_TYPE}::%OPENTF_VARIABLES%'
485
- )
486
- else:
487
- script.append(
488
- f'if [ -f "$OPENTF_VARIABLES" ]; then echo "::attach type={OPENTF_VARIABLES_TYPE}::"$OPENTF_VARIABLES""; fi'
489
- )
490
-
491
-
492
494
  def _export_opentf_workspace(runner_os: str, workspace: str, script: List[str]) -> None:
493
495
  opentf_workspace = WORKSPACE_TEMPLATE[runner_os].format(workspace=workspace)
494
496
  if runner_os == 'windows':
@@ -673,7 +675,6 @@ def make_script(
673
675
  _maybe_create_workspace(metadata, runner_os, step_sequence_id, script)
674
676
  _make_prolog(runner_os, job_id, step_sequence_id, root, script, command)
675
677
  _maybe_change_directory(command, runner_os, script, prefix)
676
- _attach_opentf_variables(runner_os, script)
677
678
 
678
679
  if command.get('shell') in (None, SHELL_DEFAULT[runner_os]):
679
680
  script += command['scripts']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: opentf-toolkit-nightly
3
- Version: 0.59.0.dev1211
3
+ Version: 0.59.0.dev1218
4
4
  Summary: OpenTestFactory Orchestrator Toolkit
5
5
  Home-page: https://gitlab.com/henixdevelopment/open-source/opentestfactory/python-toolkit
6
6
  Author: Martin Lafaix
@@ -56,10 +56,10 @@ opentf/schemas/opentestfactory.org/v1beta2/ServiceConfig.json,sha256=rEvK2YWL5lG
56
56
  opentf/scripts/launch_java_service.sh,sha256=S0jAaCuv2sZy0Gf2NGBuPX-eD531rcM-b0fNyhmzSjw,2423
57
57
  opentf/scripts/startup.py,sha256=sggwEpMx7PTaSgYzs-2uCF5YZzpsncMyTlfF_G60CrE,21518
58
58
  opentf/toolkit/__init__.py,sha256=mYeJPZ92ulbTBItqEsZgF4nnuRh6G19QPY3Jxc92ifc,23028
59
- opentf/toolkit/channels.py,sha256=kXgygE4mBw1AihdwWWlONMvN4yhbBmML4ytxb1Bgskg,23384
59
+ opentf/toolkit/channels.py,sha256=lqFGQiHYiGMaYuGAXmbyaIsW2B_9KlaUTF8LiUIQOAg,23399
60
60
  opentf/toolkit/core.py,sha256=cscUkwdwvLkerqMRL05dgtKJ42QbBQQc28kRBiyZM9o,9883
61
- opentf_toolkit_nightly-0.59.0.dev1211.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
62
- opentf_toolkit_nightly-0.59.0.dev1211.dist-info/METADATA,sha256=Bhy1y4tVEqY9xVWE2JeEh192VHscQWYd-3OgaZGmNbg,1940
63
- opentf_toolkit_nightly-0.59.0.dev1211.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
64
- opentf_toolkit_nightly-0.59.0.dev1211.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
65
- opentf_toolkit_nightly-0.59.0.dev1211.dist-info/RECORD,,
61
+ opentf_toolkit_nightly-0.59.0.dev1218.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
62
+ opentf_toolkit_nightly-0.59.0.dev1218.dist-info/METADATA,sha256=S17cV6eDmzR2udTWii9n3wFslr9i230nQQfKIc60kHk,1940
63
+ opentf_toolkit_nightly-0.59.0.dev1218.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
64
+ opentf_toolkit_nightly-0.59.0.dev1218.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
65
+ opentf_toolkit_nightly-0.59.0.dev1218.dist-info/RECORD,,