testing

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package testing provides the ephemeral test topology engine for devx test ui. It provisions short-lived, isolated database containers on random ports so that E2E/Playwright/Cypress tests can run in a clean environment without touching the developer's active development databases.

One-to-one engine mapping

devx db spawn only supports ONE container per engine type (e.g. a single devx-db-postgres). The ephemeral engine mirrors this 1:1 so each engine in devx.yaml gets exactly one ephemeral clone. Supporting multiple independent instances of the same engine type (e.g., two separate Postgres databases) is intentionally deferred to a future iteration when real use-cases emerge.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunFlow

func RunFlow(dbEngines []string, runtime, setup, command string) error

RunFlow is the primary orchestrator for `devx test ui`. It:

  1. Provisions ephemeral database containers for every engine in dbEngines.
  2. Runs optional pre-processing steps (setup) with the injected environment.
  3. Executes the main test command with the injected environment
  4. Tears down all ephemeral containers and volumes unconditionally when done.

Types

type EphemeralDB

type EphemeralDB struct {
	Engine        database.Engine
	EngineName    string
	ContainerName string
	VolumeName    string
	HostPort      int
}

EphemeralDB holds metadata about a single ephemeral database container.

Jump to

Keyboard shortcuts

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