testcontainers

package
v0.0.0-...-f29364d Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

README


name: golang/testcontainers description: Go helper and test for starting Oracle AI Database Free with testcontainers-go. tags:


Go Testcontainers Sample

This folder contains a Go helper for starting Oracle AI Database Free with testcontainers-go and a test that verifies the container can be started and queried.

Key files:

Prerequisites

  • Go
  • Docker compatible environment
  • Oracle client libraries available through DYLD_LIBRARY_PATH

Run the test

From the golang/ directory:

go test ./testcontainers

The test starts gvenzl/oracle-free:23.26.2-slim-faststart, connects as the application user, and verifies the database banner returned from v$version.

Documentation

Index

Constants

View Source
const (
	DefaultOrdsImage = "container-registry.oracle.com/database/ords:latest"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OracleContainer

type OracleContainer struct {
	*testcontainers.DockerContainer
	// contains filtered or unexported fields
}

func NewOracleContainer

func NewOracleContainer(ctx context.Context, image, appUser, appUserPassword string, opts ...testcontainers.ContainerCustomizer) (*OracleContainer, error)

func (*OracleContainer) GetDB

func (o *OracleContainer) GetDB(ctx context.Context) (*sql.DB, error)

type OrdsContainer

type OrdsContainer struct {
	*testcontainers.DockerContainer
	// contains filtered or unexported fields
}

func NewOrdsContainer

func NewOrdsContainer(
	ctx context.Context,
	image string,
	connectionString string,
	oraclePassword string,
	opts ...testcontainers.ContainerCustomizer,
) (*OrdsContainer, error)

func RunOrdsContainer

func RunOrdsContainer(ctx context.Context, opts ...OrdsContainerOption) (*OrdsContainer, error)

func (*OrdsContainer) BaseURL

func (o *OrdsContainer) BaseURL(ctx context.Context) (string, error)

func (*OrdsContainer) HTTPPort

func (o *OrdsContainer) HTTPPort(ctx context.Context) (nat.Port, error)

func (*OrdsContainer) HTTPSPort

func (o *OrdsContainer) HTTPSPort(ctx context.Context) (nat.Port, error)

func (*OrdsContainer) MongoDBAPIPort

func (o *OrdsContainer) MongoDBAPIPort(ctx context.Context) (nat.Port, error)

type OrdsContainerOption

type OrdsContainerOption func(*ordsContainerConfig) error

func WithOrdsContainerCustomizers

func WithOrdsContainerCustomizers(customizers ...testcontainers.ContainerCustomizer) OrdsContainerOption

func WithOrdsDatabaseConnectionString

func WithOrdsDatabaseConnectionString(connectionString string) OrdsContainerOption

func WithOrdsImage

func WithOrdsImage(image string) OrdsContainerOption

func WithOrdsOraclePassword

func WithOrdsOraclePassword(oraclePassword string) OrdsContainerOption

func WithOrdsSchema

func WithOrdsSchema(username, password, connectDescriptor string) OrdsContainerOption

type OrdsSchemaConfiguration

type OrdsSchemaConfiguration struct {
	Username          string
	Password          string
	ConnectDescriptor string
}

Jump to

Keyboard shortcuts

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