-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
It would be useful if this tool would work the same for opa eval --coverage as it does for opa test.
The output format is slightly different, as the coverage will be found under a coverage attribute, but the format of the coverage report is the same, so should be easy to detect, I think.
Example:
opa eval --coverage -d foo.rego data
{
"result": [
{
"expressions": [
{
"value": {
"policies": {
"cross_env": {
"dev_to_prod": {
"match": []
}
}
}
},
"text": "data",
"location": {
"row": 1,
"col": 1
}
}
]
}
],
"coverage": {
"files": {
"foo.rego": {
"covered": [
{
"start": {
"row": 4
},
"end": {
"row": 4
}
}
],
"not_covered": [
{
"start": {
"row": 3
},
"end": {
"row": 3
}
},
{
"start": {
"row": 5
},
"end": {
"row": 5
}
}
],
"covered_lines": 1,
"not_covered_lines": 2,
"coverage": 33.35
}
},
"covered_lines": 1,
"not_covered_lines": 2,
"coverage": 33.35
}
}Metadata
Metadata
Assignees
Labels
No labels