opentf-toolkit-nightly 0.59.0.dev1214__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
 
@@ -428,6 +433,9 @@ def process_output(
428
433
 
429
434
  metadata: Dict[str, Any] = event['metadata']
430
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
+ )
431
439
  separator = '\\' if is_windows else '/'
432
440
  outputs = {}
433
441
  logs: List[str] = []
@@ -466,6 +474,9 @@ def process_output(
466
474
  if metadata.get('artifacts'):
467
475
  del metadata['artifacts']
468
476
 
477
+ if metadata['step_sequence_id'] != CHANNEL_RELEASE:
478
+ _attach(opentfvariables, f'type={OPENTF_VARIABLES_TYPE}')
479
+
469
480
  result = make_event(EXECUTIONRESULT, metadata=metadata, status=resp)
470
481
 
471
482
  if outputs:
@@ -480,17 +491,6 @@ def process_output(
480
491
  return result
481
492
 
482
493
 
483
- def _attach_opentf_variables(runner_os: str, script: List[str]):
484
- if runner_os == 'windows':
485
- script.append(
486
- f'@if exist "%OPENTF_VARIABLES%" echo ::attach type={OPENTF_VARIABLES_TYPE}::%OPENTF_VARIABLES%'
487
- )
488
- else:
489
- script.append(
490
- f'if [ -f "$OPENTF_VARIABLES" ]; then echo "::attach type={OPENTF_VARIABLES_TYPE}::"$OPENTF_VARIABLES""; fi'
491
- )
492
-
493
-
494
494
  def _export_opentf_workspace(runner_os: str, workspace: str, script: List[str]) -> None:
495
495
  opentf_workspace = WORKSPACE_TEMPLATE[runner_os].format(workspace=workspace)
496
496
  if runner_os == 'windows':
@@ -675,7 +675,6 @@ def make_script(
675
675
  _maybe_create_workspace(metadata, runner_os, step_sequence_id, script)
676
676
  _make_prolog(runner_os, job_id, step_sequence_id, root, script, command)
677
677
  _maybe_change_directory(command, runner_os, script, prefix)
678
- _attach_opentf_variables(runner_os, script)
679
678
 
680
679
  if command.get('shell') in (None, SHELL_DEFAULT[runner_os]):
681
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.dev1214
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=0kaoSHAOEk8YxnQUNFZFB-eHa_SpZtbzhiVUJRjBkvo,23459
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.dev1214.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
62
- opentf_toolkit_nightly-0.59.0.dev1214.dist-info/METADATA,sha256=JoKYEtOwdsWC7_sPXoIQLMlJcDVE7uo12-ezonH39wo,1940
63
- opentf_toolkit_nightly-0.59.0.dev1214.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
64
- opentf_toolkit_nightly-0.59.0.dev1214.dist-info/top_level.txt,sha256=_gPuE6GTT6UNXy1DjtmQSfCcZb_qYA2vWmjg7a30AGk,7
65
- opentf_toolkit_nightly-0.59.0.dev1214.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,,