adapters

package
v0.17.7 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package adapters provides helpers for dealing with adapter tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntegrationTest added in v0.17.3

func IntegrationTest(t *testing.T, adapterName string, testFunc IntegrationTestFunc)

IntegrationTest tests the given adapter with the given test function. It takes care of setting up all surroundings for the integration test.

func Setup

func Setup[T any](t *testing.T, hf http.HandlerFunc, setupFunc func(dataset string, client *axiom.Client) (T, func())) (T, func())

Setup sets up a test http server that serves the given handler function. It uses the given setup function to retrieve the adapter to be tested that must be configured to talk to the client passed to the setup function.

Types

type IntegrationTestFunc added in v0.17.3

type IntegrationTestFunc func(ctx context.Context, dataset string, client *axiom.Client)

IntegrationTestFunc is a function that provides a client that is configured with an API token for a unique test dataset. The client should be passed to the adapter to be tested as well as the target dataset.

Jump to

Keyboard shortcuts

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