Skip to content

Commit

Permalink
move metadata into SingleRunTestPayload instead of RunOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
sslivkoff committed Jul 17, 2023
1 parent 3cbf6fc commit c897403
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
15 changes: 2 additions & 13 deletions flood/runners/generic_runner/generic_runner_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def run(
) -> flood.RunOutput:
"""generate and run tests against nodes"""
import os
import sys

# get output_dir
use_output_dir = _get_output_dir(output_dir)
Expand Down Expand Up @@ -56,12 +55,7 @@ def run(
include_deep_output=include_deep_output,
deep_check=deep_check,
)
return {
'flood_version': flood.__version__,
'dependency_versions': flood.get_dependency_versions(),
'cli_args': list(sys.argv),
'single_run': output,
}
return {'single_run': output}

# generate new test
else:
Expand All @@ -86,12 +80,7 @@ def run(
include_deep_output=include_deep_output,
deep_check=deep_check,
)
return {
'flood_version': flood.__version__,
'dependency_versions': flood.get_dependency_versions(),
'cli_args': list(sys.argv),
'single_run': output,
}
return {'single_run': output}
elif test_name in flood.get_multi_test_generators():
raise NotImplementedError('multi tests not supported yet')
else:
Expand Down
5 changes: 5 additions & 0 deletions flood/runners/single_runner/single_runner_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def _save_single_run_results(
t_run_end: float,
) -> flood.SingleRunResultsPayload:
import os
import sys

import orjson

if not os.path.isdir(output_dir):
Expand All @@ -81,6 +83,9 @@ def _save_single_run_results(

path = _path_templates['single_run_results'].format(output_dir=output_dir)
payload: flood.SingleRunResultsPayload = {
'flood_version': flood.get_flood_version(),
'dependency_versions': flood.get_dependency_versions(),
'cli_args': list(sys.argv),
'type': 'single_test',
't_run_start': t_run_start,
't_run_end': t_run_end,
Expand Down
8 changes: 4 additions & 4 deletions flood/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,18 @@ class SingleRunTestPayload(typing.TypedDict):
test_parameters: TestGenerationParameters

class SingleRunResultsPayload(typing.TypedDict):
flood_version: str
dependency_versions: typing.Mapping[str, str | None]
cli_args: typing.Sequence[str]
type: RunType
t_run_start: float
t_run_end: float
type: RunType
nodes: Nodes
results: typing.Mapping[str, LoadTestOutput]

# runner outputs

class RunOutput(typing.TypedDict):
flood_version: str
dependency_versions: typing.Mapping[str, str | None]
cli_args: typing.Sequence[str]
single_run: SingleRunOutput

class SingleRunOutput(typing.TypedDict):
Expand Down

0 comments on commit c897403

Please sign in to comment.