robotframework-events 0.2.0__tar.gz → 0.3.0__tar.gz
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.
- {robotframework_events-0.2.0/src/robotframework_events.egg-info → robotframework_events-0.3.0}/PKG-INFO +1 -1
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/__init__.py +1 -1
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/convert.py +1 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/events-v1.schema.json +5 -1
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/events.py +1 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/listener.py +17 -13
- {robotframework_events-0.2.0 → robotframework_events-0.3.0/src/robotframework_events.egg-info}/PKG-INFO +1 -1
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/tests/test_events.py +1 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/LICENSE +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/README.md +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/pyproject.toml +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/setup.cfg +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/__main__.py +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/cli.py +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/py.typed +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/reader.py +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/state.py +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events.egg-info/SOURCES.txt +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events.egg-info/dependency_links.txt +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events.egg-info/entry_points.txt +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events.egg-info/requires.txt +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events.egg-info/top_level.txt +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/tests/test_benchmark.py +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/tests/test_cli.py +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/tests/test_conformance.py +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/tests/test_model.py +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/tests/test_reader.py +0 -0
- {robotframework_events-0.2.0 → robotframework_events-0.3.0}/tests/test_state.py +0 -0
|
@@ -51,7 +51,11 @@
|
|
|
51
51
|
"rf": { "description": "Robot Framework version.", "type": "string" },
|
|
52
52
|
"python": { "description": "Python version.", "type": "string" },
|
|
53
53
|
"pid": { "type": "integer" },
|
|
54
|
-
"cwd": { "type": "string" }
|
|
54
|
+
"cwd": { "type": "string" },
|
|
55
|
+
"outputdir": {
|
|
56
|
+
"description": "The run's output directory; log.html links screenshots and other files relative to it.",
|
|
57
|
+
"type": "string"
|
|
58
|
+
}
|
|
55
59
|
}
|
|
56
60
|
},
|
|
57
61
|
"run.ended": {
|
{robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/listener.py
RENAMED
|
@@ -329,20 +329,21 @@ class Listener:
|
|
|
329
329
|
with contextlib.suppress(OSError):
|
|
330
330
|
self._out.flush()
|
|
331
331
|
|
|
332
|
-
def
|
|
332
|
+
def _output_locations(self) -> tuple[str, str | None]:
|
|
333
|
+
"""${OUTPUT DIR} and ${OUTPUT FILE} of the run (cwd and None when they cannot be read)."""
|
|
334
|
+
from robot.libraries.BuiltIn import BuiltIn
|
|
335
|
+
|
|
336
|
+
try:
|
|
337
|
+
outdir = BuiltIn().get_variable_value("${OUTPUT DIR}") or os.getcwd()
|
|
338
|
+
output = BuiltIn().get_variable_value("${OUTPUT FILE}")
|
|
339
|
+
except Exception:
|
|
340
|
+
return os.getcwd(), None
|
|
341
|
+
return str(outdir), output
|
|
342
|
+
|
|
343
|
+
def _open_file(self, outdir: str, output: str | None) -> None:
|
|
333
344
|
if self._file_option and self._file_option.upper() == "NONE":
|
|
334
345
|
return
|
|
335
|
-
if self._file_option
|
|
336
|
-
path = Path(self._file_option)
|
|
337
|
-
else:
|
|
338
|
-
from robot.libraries.BuiltIn import BuiltIn
|
|
339
|
-
|
|
340
|
-
try:
|
|
341
|
-
outdir = BuiltIn().get_variable_value("${OUTPUT DIR}") or os.getcwd()
|
|
342
|
-
output = BuiltIn().get_variable_value("${OUTPUT FILE}")
|
|
343
|
-
except Exception:
|
|
344
|
-
outdir, output = os.getcwd(), None
|
|
345
|
-
path = default_events_file(outdir, output)
|
|
346
|
+
path = Path(self._file_option) if self._file_option else default_events_file(outdir, output)
|
|
346
347
|
try:
|
|
347
348
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
348
349
|
# buffered; flushed after every test and at close so tailing readers see progress
|
|
@@ -370,7 +371,8 @@ class Listener:
|
|
|
370
371
|
if not self._started:
|
|
371
372
|
self._started = True
|
|
372
373
|
self._root = result
|
|
373
|
-
self.
|
|
374
|
+
outdir, output = self._output_locations()
|
|
375
|
+
self._open_file(outdir, output)
|
|
374
376
|
self._emit(
|
|
375
377
|
"run.started",
|
|
376
378
|
run=self._run_id,
|
|
@@ -378,6 +380,8 @@ class Listener:
|
|
|
378
380
|
python=platform.python_version(),
|
|
379
381
|
pid=os.getpid(),
|
|
380
382
|
cwd=os.getcwd(),
|
|
383
|
+
# log.html links screenshots and other files relative to it
|
|
384
|
+
outputdir=outdir,
|
|
381
385
|
)
|
|
382
386
|
source = str(data.source) if data.source else None
|
|
383
387
|
self._emit(
|
|
@@ -25,6 +25,7 @@ def test_every_event_has_envelope_fields_and_gapless_seq(sample_events):
|
|
|
25
25
|
def test_run_events_frame_the_stream(sample_events):
|
|
26
26
|
assert sample_events[0]["type"] == "run.started"
|
|
27
27
|
assert sample_events[0]["run"]
|
|
28
|
+
assert sample_events[0]["outputdir"]
|
|
28
29
|
assert sample_events[-1]["type"] == "run.ended"
|
|
29
30
|
assert sample_events[-1]["stats"] == {"total": 3, "passed": 1, "failed": 1, "skipped": 1}
|
|
30
31
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/__main__.py
RENAMED
|
File without changes
|
{robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/cli.py
RENAMED
|
File without changes
|
{robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/py.typed
RENAMED
|
File without changes
|
{robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/reader.py
RENAMED
|
File without changes
|
{robotframework_events-0.2.0 → robotframework_events-0.3.0}/src/robotframework_events/state.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|