testing

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package testing provides utilities for tests that depend on feature flags.

Feature flags are shared state. When tests change feature flags, they must ensure that no other tests are affected.

  1. They must restore the default feature flag state when the test is finished.

  2. They must not run in parallel with other tests that could be affected by changed feature flags state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithFeatureFlag

func WithFeatureFlag(ff *featureflag.FeatureFlag, enabled bool) func()

WithFeatureFlag sets the given feature flag to the given state and returns a reset function to revert to the previous feature flag state.

The returned function is meant to be called deferred by the caller.

Example:

defer testing.WithFeatureFlag(featureflag.Dummy, true)()

Types

This section is empty.

Jump to

Keyboard shortcuts

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