From 7a7c96f5c6b50eb77a272b4b17182e6a27e79754 Mon Sep 17 00:00:00 2001 From: sbp-bvanb Date: Mon, 9 Dec 2024 21:51:33 +0100 Subject: [PATCH] fix: Ignore JSON when running OPA as it only supports rego --- Taskfile.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index add8fd0..74b852d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -254,11 +254,13 @@ tasks: silent: true cmds: - | + opa_cmd="opa test . --ignore \"*.json\"" + for dir in $(find . -type f -name '*.rego' -exec dirname {} \; | sort -u); do - echo "Running opa test in directory: $dir" - (cd "$dir" && opa test . -v --explain={{.QUERY_EXPLANATION}}) + echo "Running ${opa_cmd} in directory: $dir" + (cd "$dir" && ${opa_cmd} -v --explain={{.QUERY_EXPLANATION}}) - opa_code_coverage_overview=$(cd "$dir" && opa test . -c) + opa_code_coverage_overview=$(cd "$dir" && ${opa_cmd} -c) echo "OPA code coverage overview:" echo "${opa_code_coverage_overview}"