Skip to content

Commit

Permalink
Made inlining for stdout and stderr possible and made everything more…
Browse files Browse the repository at this point in the history
… consitent
  • Loading branch information
BrentBlanckaert committed Feb 1, 2025
1 parent 1b3b892 commit 32bb7d9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
19 changes: 6 additions & 13 deletions tested/dsl/schema-strict.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,13 @@
},
{
"required" : [
"path"
"content"
]
}
],
"properties" : {
"path": {
"type" : "string",
"description" : "The path to the file containing the text value."
"content": {
"$ref" : "#/definitions/textualType"
},
"data" : {
"$ref" : "#/definitions/textualType"
Expand Down Expand Up @@ -562,19 +561,13 @@
"required" : [
"oracle",
"file",
"path"
"content"
]
}
],
"required" : [
"oracle",
"file",
"data"
],
"properties" : {
"path": {
"type" : "string",
"description" : "The path to the file containing the text value."
"content": {
"$ref" : "#/definitions/textualType"
},
"data" : {
"$ref" : "#/definitions/textualType"
Expand Down
19 changes: 6 additions & 13 deletions tested/dsl/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,13 @@
},
{
"required" : [
"path"
"content"
]
}
],
"properties" : {
"path": {
"type" : "string",
"description" : "The path to the file containing the text value."
"content": {
"$ref" : "#/definitions/textualType"
},
"data" : {
"$ref" : "#/definitions/textualType"
Expand Down Expand Up @@ -562,19 +561,13 @@
"required" : [
"oracle",
"file",
"path"
"content"
]
}
],
"required" : [
"oracle",
"file",
"data"
],
"properties" : {
"path": {
"type" : "string",
"description" : "The path to the file containing the text value."
"content": {
"$ref" : "#/definitions/textualType"
},
"data" : {
"$ref" : "#/definitions/textualType"
Expand Down
20 changes: 17 additions & 3 deletions tested/dsl/translate_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,18 @@ def _convert_text_output_channel(

if isinstance(stream, str):
config = context.config.get(config_name, dict())
if isinstance(stream, PathString):
path = stream
raw_data = stream
else:
assert isinstance(stream, dict)
if (path := stream.get("path")) is not None:
data = stream.get("content", stream.get("data"))
assert data is not None

if isinstance(data, PathString):
path = data
config = context.config.get(config_name, dict())
raw_data = str(path)
raw_data = data
else:
config = context.merge_inheritable_with_specific_config(stream, config_name)
raw_data = str(stream["data"])
Expand All @@ -478,7 +484,15 @@ def _convert_text_output_channel(
data = raw_data

if isinstance(stream, str):
return TextOutputChannel(data=data, oracle=GenericTextOracle(options=config))
if path is not None:
return TextOutputChannel(
data=data,
oracle=GenericTextOracle(options=config),
type=TextChannelType.FILE,
)
return TextOutputChannel(
data=data, oracle=GenericTextOracle(options=config)
)
else:
assert isinstance(stream, dict)
if "oracle" not in stream or stream["oracle"] == "builtin":
Expand Down

0 comments on commit 32bb7d9

Please sign in to comment.