MartinBasti / hacbs-test

HACBS-test repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HACBS-TEST

This is HACBS-test team repository. Purpose of this repo is to store resources, currently for tekton tasks and pipelines.

Prerequisites

Install the following list of packages to run the policies locally.

  1. Conftest
  2. jq
  3. Skopeo

Policy Unit Testing

In addition to prerequisites install the packages below to run unit testing.

  1. OPA

Running command opa test <path> [path [...]] executes unit testing for policy, path points to the policy folder and unit testing fixtures data folder.

Running policy unit testing with code coverage report opa test <path> [path [...]] -c

Running policy unit testing and exit with non-zero status if coverage is less than threshold % policy test <path> [path [...]] --threshold float

In this repository, we run opa test policies unittests unittests/test_data -c > /tmp/policy_unittest_result.json to get unit testing code coverage and then analyze.

Policy Integration Testing

In addition to prerequisites install the packages below to run integration testing.

  1. BATS

Run Integration tests locally by export the policies directory path to policies folder as shown below.

export POLICY_PATH=policies

sh test/entrypoint.sh

Contact

About

HACBS-test repository


Languages

Language:Open Policy Agent 65.1%Language:Shell 29.3%Language:Dockerfile 5.6%