From 53b0e65d665eb74ae032d012dd347a8c632ca646 Mon Sep 17 00:00:00 2001 From: Sondre Sortland Date: Mon, 3 May 2021 14:35:12 +0200 Subject: [PATCH] Re-add stderr and stdout info --- python/job_runner/reporting/event.py | 7 ++++++- tests/job_runner/test_event_reporter.py | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/python/job_runner/reporting/event.py b/python/job_runner/reporting/event.py index 635fbe5e8..665c724da 100644 --- a/python/job_runner/reporting/event.py +++ b/python/job_runner/reporting/event.py @@ -8,6 +8,7 @@ ) import queue import threading +from pathlib import Path from job_runner.util.client import Client _FM_JOB_START = "com.equinor.ert.forward_model_job.start" @@ -98,8 +99,12 @@ def _job_handler(self, msg): { "type": _FM_JOB_START, "source": job_path, + "datacontenttype": "application/json", + }, + { + "stdout": str(Path(msg.job.std_out).resolve()), + "stderr": str(Path(msg.job.std_err).resolve()), }, - None, ) ) if not msg.success(): diff --git a/tests/job_runner/test_event_reporter.py b/tests/job_runner/test_event_reporter.py index 50d8989e5..05e0b4b56 100644 --- a/tests/job_runner/test_event_reporter.py +++ b/tests/job_runner/test_event_reporter.py @@ -32,6 +32,8 @@ def test_report_with_successful_start_message_argument(unused_tcp_port): event = json.loads(lines[0]) assert event["type"] == _FM_JOB_START assert event["source"] == "/ert/ee/ee_id/real/0/step/0/job/0" + assert os.path.basename(event["data"]["stdout"]) == "stdout" + assert os.path.basename(event["data"]["stderr"]) == "stderr" def test_report_with_failed_start_message_argument(unused_tcp_port):