diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-07-12 11:54:12 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-07-12 11:54:12 +0200 |
commit | fac7e7680e00dfc63eec41a33dff86d31571eb4b (patch) | |
tree | d341e6569290a21554ea9e5251c756b2b68096e8 /rules/shell/test/RULES | |
parent | 8d715c335756e406aea8a7e3e9e2266f69fbdeb9 (diff) | |
parent | 6fc2c2f66740c533d80990659cfce29b7db07eda (diff) | |
download | rules-cc-fac7e7680e00dfc63eec41a33dff86d31571eb4b.tar.gz |
Merge subtree 'rules' into rules-cc
Diffstat (limited to 'rules/shell/test/RULES')
-rw-r--r-- | rules/shell/test/RULES | 117 |
1 files changed, 92 insertions, 25 deletions
diff --git a/rules/shell/test/RULES b/rules/shell/test/RULES index 91b7637..d9d8587 100644 --- a/rules/shell/test/RULES +++ b/rules/shell/test/RULES @@ -1,4 +1,31 @@ -{ "script": +{ "summarizer": + { "doc": + ["Specify a test summarizer together with the required additional fields"] + , "target_fields": ["summarizer"] + , "string_fields": ["artifacts"] + , "imports": {"stage": ["./", "../..", "stage_singleton_field"]} + , "field_doc": + { "summarizer": ["The single artifact acting as summarizer"] + , "artifacts": + [ "Any additional artifacts, besides \"result\", the summaries needs from" + , "the individual test results" + ] + } + , "expression": + { "type": "RESULT" + , "artifacts": + { "type": "let*" + , "bindings": [["fieldname", "summarizer"], ["location", "summarizer"]] + , "body": {"type": "CALL_EXPRESSION", "name": "stage"} + } + , "provides": + { "type": "singleton_map" + , "key": "artifacts" + , "value": {"type": "FIELD", "name": "artifacts"} + } + } + } +, "script": { "doc": ["Shell test, given by a test script"] , "target_fields": ["deps", "test"] , "string_fields": ["keep", "name"] @@ -52,7 +79,8 @@ ] , "summarizer": [ "Tool to aggregate the results of individual test runs (for flakyness" - , "detection) to an overall test result." + , "detection) to an overall test result. If more fields than the result" + , "itself is needed, those can be specified using the \"summarizer\" rule." ] , "defaults": ["The shell toolcahin to use."] } @@ -97,6 +125,7 @@ , "work: In this directory, all the files specified to \"keep\" are staged" , "time-start/time-stop: The time (decimally coded) in seconds since the" , " epoch when the test invocation started and ended." + , "pwd: the directory in which the test was carried out" ] , "runfiles_doc": [ "A tree consisting of the artifacts staged at the name of the test." @@ -115,6 +144,7 @@ , "host transition": ["transitions", "maybe for host"] , "target properties": ["transitions", "target properties"] , "default-PATH": ["./", "../../CC", "default-PATH"] + , "field_list": ["", "field_list_provider"] } , "config_transitions": { "deps": [{"type": "CALL_EXPRESSION", "name": "host transition"}] @@ -162,7 +192,7 @@ , "then": { "type": "let*" , "bindings": - [ [ "attempts" + [ [ "attempts (plain)" , { "type": "map_union" , "$1": { "type": "foreach" @@ -174,37 +204,56 @@ , "body": { "type": "singleton_map" , "key": {"type": "var", "name": "ATTEMPT"} - , "value": - { "type": "TREE" - , "$1": {"type": "CALL_EXPRESSION", "name": "action"} - } + , "value": {"type": "CALL_EXPRESSION", "name": "action"} } } } ] , [ "summarizer" + , { "type": "let*" + , "bindings": + [["fieldname", "summarizer"], ["location", "summarizer"]] + , "body": {"type": "CALL_EXPRESSION", "name": "stage"} + } + ] + , [ "summary artifacts" + , { "type": "++" + , "$1": + [ ["result"] + , { "type": "let*" + , "bindings": + [["provider", "artifacts"], ["fieldname", "summarizer"]] + , "body": {"type": "CALL_EXPRESSION", "name": "field_list"} + } + ] + } + ] + , [ "attempts (for summary)" , { "type": "map_union" , "$1": - { "type": "foreach" - , "var": "x" - , "range": {"type": "FIELD", "name": "summarizer"} + { "type": "foreach_map" + , "range": {"type": "var", "name": "attempts (plain)"} , "body": - { "type": "map_union" - , "$1": - { "type": "foreach" - , "var": "x" - , "range": - { "type": "values" + { "type": "singleton_map" + , "key": {"type": "var", "name": "_"} + , "value": + { "type": "TREE" + , "$1": + { "type": "map_union" , "$1": - { "type": "DEP_ARTIFACTS" - , "dep": {"type": "var", "name": "x"} + { "type": "foreach" + , "range": {"type": "var", "name": "summary artifacts"} + , "body": + { "type": "singleton_map" + , "key": {"type": "var", "name": "_"} + , "value": + { "type": "lookup" + , "map": {"type": "var", "name": "$_"} + , "key": {"type": "var", "name": "_"} + } + } } } - , "body": - { "type": "singleton_map" - , "key": "summarizer" - , "value": {"type": "var", "name": "x"} - } } } } @@ -221,7 +270,7 @@ , "inputs": { "type": "map_union" , "$1": - [ {"type": "var", "name": "attempts"} + [ {"type": "var", "name": "attempts (for summary)"} , {"type": "var", "name": "summarizer"} ] } @@ -245,10 +294,28 @@ } } ] + , [ "attempts" + , { "type": "map_union" + , "$1": + { "type": "foreach_map" + , "range": {"type": "var", "name": "attempts (plain)"} + , "body": + { "type": "singleton_map" + , "key": {"type": "var", "name": "_"} + , "value": + {"type": "TREE", "$1": {"type": "var", "name": "$_"}} + } + } + } + ] , [ "artifacts" , { "type": "map_union" , "$1": - [ {"type": "var", "name": "summary"} + [ { "type": "singleton_map" + , "key": "pwd" + , "value": {"type": "BLOB", "data": "/summary"} + } + , {"type": "var", "name": "summary"} , { "type": "singleton_map" , "key": "work" , "value": |