tests

package
v1.26.7 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertRequest

func AssertRequest[T interface {
	StatusCode() int
}](v T, err error) func(t *testing.T, want int) T

func IsSharedPostgresDatabase

func IsSharedPostgresDatabase() bool

IsSharedPostgresDatabase reports whether the current integration run uses a shared PostgreSQL database URL, which means global settings writes can leak across concurrently running test packages.

We do this on github actions as one of the 3 databases. The test suite is actually intentionally meant to be run on a shared database to ensure that many API calls in a non-deterministic order doesn't cause any issues. The only minor issue is that a small handful of features will affect global state and causes that shared db test to fail in odd ways. To get around this, we just skip a couple of tests that touch global state as part of their process such as global authentication mode (handle vs email) all other tests will work perfectly fine in any order and mostly with t.Parallel() which is great!

func Ok deprecated

func Ok(t *testing.T, err error, resp WithStatusCode)

Deprecated: use AssertRequest instead.

func Status deprecated

func Status(t *testing.T, err error, resp WithStatusCode, status int)

Deprecated: use AssertRequest instead.

Types

type ResponseShape

type ResponseShape struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      any
	JSONDefault  *openapi.InternalServerError
}

type WithStatusCode

type WithStatusCode interface {
	StatusCode() int
}

Directories

Path Synopsis
plugin

Jump to

Keyboard shortcuts

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