Skip to content

Commit

Permalink
engine: Add conceal key to trigger conf
Browse files Browse the repository at this point in the history
This is a bugfix, since the trigger conf is used for validation purposes.
  • Loading branch information
cassava committed Mar 3, 2023
1 parent 918f795 commit 385b5e4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine/src/stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ struct TriggerConf : public PersistentConfable {
Source source{Source::FILESYSTEM};
Conf action{};
Conf event{};
bool conceal{false};
bool sticky{false};
bool optional{false};

Expand All @@ -804,6 +805,7 @@ struct TriggerConf : public PersistentConfable {
{"event", make_schema(&event, EANDA_SCHEMA, "event").require()},
{"action", make_schema(&action, EANDA_SCHEMA, "action").require()},
{"sticky", make_schema(&sticky, "whether trigger should be sticky")},
{"conceal", make_schema(&conceal, "whether trigger should be concealed in history")},
{"optional", make_schema(&optional, "whether errors creating event or action should be ignored")},
{"at", Ignore("time at which trigger was executed", JsonType::string)},
{"since", Ignore("time since which trigger was in queue", JsonType::string)},
Expand Down
4 changes: 4 additions & 0 deletions engine/tests/test_engine_json_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,10 @@
"at": {
"description": "time at which trigger was executed"
},
"conceal": {
"description": "whether trigger should be concealed in history",
"type": "boolean"
},
"event": {
"anyOf": [
{
Expand Down
10 changes: 10 additions & 0 deletions engine/tests/test_engine_nop_smoketest_dump.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,31 @@
],
"name": "bundle"
},
"conceal": false,
"event": "start",
"optional": false,
"source": "filesystem",
"sticky": false
},
{
"action": "basic/hmi=enable",
"conceal": false,
"event": "next=1",
"optional": false,
"source": "filesystem",
"sticky": false
},
{
"action": "basic/hmi=resume",
"conceal": false,
"event": "time=5",
"optional": false,
"source": "filesystem",
"sticky": false
},
{
"action": "basic/hmi=!resume",
"conceal": false,
"event": "time=5.5",
"optional": false,
"source": "filesystem",
Expand All @@ -132,6 +136,7 @@
}
]
},
"conceal": false,
"event": "time=6",
"label": "Push and release basic/hmi=plus",
"optional": false,
Expand All @@ -140,13 +145,15 @@
},
{
"action": "fail",
"conceal": false,
"event": "virtue/failure",
"optional": false,
"source": "filesystem",
"sticky": false
},
{
"action": "fail",
"conceal": false,
"event": "default_speed/kmph=>0.0",
"label": "Vehicle default should never move with the nop binding.",
"optional": false,
Expand All @@ -155,20 +162,23 @@
},
{
"action": "log=info: Running nop/basic smoketest.",
"conceal": false,
"event": "start",
"optional": false,
"source": "filesystem",
"sticky": false
},
{
"action": "realtime_factor=-1",
"conceal": false,
"event": "start",
"optional": false,
"source": "filesystem",
"sticky": false
},
{
"action": "succeed",
"conceal": false,
"event": "time=60",
"optional": false,
"source": "filesystem",
Expand Down

0 comments on commit 385b5e4

Please sign in to comment.