e2e

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended. For newer features and behaviours, such as defaulting to the Rego v1 syntax, use the corresponding components in the github.com/Axot017/opa/v1 package instead. See https://www.openpolicyagent.org/docs/latest/v0-compatibility/ for more information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAPIServerTestParams

func NewAPIServerTestParams() runtime.Params

NewAPIServerTestParams creates a new set of runtime.Params with enough default values filled in to start the server. Options can/should be customized for the test case.

func WithRuntime

func WithRuntime(t *testing.T, opts TestRuntimeOpts, params runtime.Params, f func(rt *TestRuntime))

WithRuntime invokes f with a new TestRuntime after waiting for server readiness. This function can be called inside of each test that requires a runtime as opposed to RunTests which can only be called once.

Types

type TestRuntime

type TestRuntime = v1.TestRuntime

TestRuntime holds metadata and provides helper methods to interact with the runtime being tested.

func NewTestRuntime

func NewTestRuntime(params runtime.Params) (*TestRuntime, error)

NewTestRuntime returns a new TestRuntime.

func NewTestRuntimeWithOpts

func NewTestRuntimeWithOpts(opts TestRuntimeOpts, params runtime.Params) (*TestRuntime, error)

NewTestRuntimeWithOpts returns a new TestRuntime.

func WrapRuntime

func WrapRuntime(ctx context.Context, cancel context.CancelFunc, rt *runtime.Runtime) *TestRuntime

WrapRuntime creates a new TestRuntime by wrapping an existing runtime

type TestRuntimeOpts

type TestRuntimeOpts = v1.TestRuntimeOpts

TestRuntimeOpts contains parameters for the test runtime.

Directories

Path Synopsis
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended.
Deprecated: This package is intended for older projects transitioning from OPA v0.x and will remain for the lifetime of OPA v1.x, but its use is not recommended.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL