package logs

import "github.com/open-policy-agent/opa/test/e2e/logs"

Index

Functions

func GeneratePolicy

func GeneratePolicy(ruleCounts int, ruleHits int) string

GeneratePolicy generates a policy for use in Decision Log e2e tests. The `ruleCounts` determine how many total rules to generate, and the `ruleHits` are the number of them that will be evaluated. This is keyed off of the `input.hit` boolean value.

func RunDecisionLoggerBenchmark

func RunDecisionLoggerBenchmark(b *testing.B, rt *e2e.TestRuntime)

RunDecisionLoggerBenchmark runs a benchmark for decision logs with a pre-configured test runtime

Types

type TestLogServer

type TestLogServer struct {
	// contains filtered or unexported fields
}

TestLogServer implements the decision log endpoint for e2e testing.

func (*TestLogServer) Start

func (t *TestLogServer) Start()

Start the test server listening on a random port.

func (*TestLogServer) Stop

func (t *TestLogServer) Stop()

Stop the test server. There is a 5 second graceful shutdown period and then it will be forcefully stopped.

func (*TestLogServer) URL

func (t *TestLogServer) URL() string

URL string representation for the current server. Requires that the server has already been started.

Source Files

utils.go

Directories

PathSynopsis
test/e2e/logs/console
Version
v0.42.2
Published
Jul 13, 2022
Platform
js/wasm
Imports
9 packages
Last checked
32 minutes ago

Tools for package owners.