end2end

package
v0.104.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 19 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dalgo/end2end

End-to-end conformance tests for DALgo database adapters.

Adapters should import github.com/dal-go/dalgo/end2end and call end2end.TestDalgoDB from their own integration tests.

Query capability reporting

TestDalgoDB(t, db, errQuerySupport, eventuallyConsistent) gates the whole query suite on errQuerySupport: pass a non-nil error and every query test is skipped (for adapters with no query support at all).

Beyond that coarse gate, individual query features are capability-reported per query. The suite exercises advanced shapes — column projection, GROUP BY aggregation with HAVING, and both the records and recordset read paths — and an adapter that does not implement a given shape is expected to return an error that wraps dal.ErrNotSupported. The shared tests detect this via errors.Is(err, dal.ErrNotSupported) and t.Skip that sub-test rather than failing. So returning dal.ErrNotSupported (not a silent wrong result) is the contract for an unsupported query feature; adapters opt into coverage simply by implementing the feature.

Both read paths are covered for the same query:

  • records reader — tx.ExecuteQueryToRecordsReader / dal.ExecuteQueryAndReadAllToRecords.
  • recordset reader — tx.ExecuteQueryToRecordsetReader / dal.ExecuteQueryAndReadAllToRecordset (the columnar path used by tabular consumers such as DataTug).

Documentation

Overview

Package end2end is a shared adapter conformance harness. TestDalgoDB runs single-record, multi-record, and query checks against a dal.DB. Query checks, including access checks, run only when the driver supports queries.

Index

Constants

View Source
const (
	// TestEntitiesNamePrefix is the prefix of the end-to-end table or collection names.
	TestEntitiesNamePrefix = "DalgoE2E_"

	// E2ETestKind1 defines table or collection name for an entity to be stored in
	E2ETestKind1 = TestEntitiesNamePrefix + "E2ETest1"
	// E2ETestKind2 defines table or collection name for an entity to be stored in
	E2ETestKind2 = TestEntitiesNamePrefix + "E2ETest2"
)

Variables

This section is empty.

Functions

func TestDalgoDB

func TestDalgoDB(t *testing.T, db dal.DB, errQuerySupport error, eventuallyConsistent bool)

TestDalgoDB tests a dalgo DB implementation

Types

type TestData

type TestData struct {
	StringProp  string `json:"StringProp,omitempty" db:"StringProp"`
	IntegerProp int    `json:"IntegerProp" db:"IntegerProp"`
}

TestData describes a test entity to be stored in a DALgo database

func (TestData) Validate

func (v TestData) Validate() error

Validate returns error if not valid

type User

type User struct {
	Title string `json:"title,omitempty"`
	Email string `json:"email,omitempty"`
}

User holds a title and an email.

Directories

Path Synopsis
Package models holds the city fixture used by end-to-end adapter tests.
Package models holds the city fixture used by end-to-end adapter tests.

Jump to

Keyboard shortcuts

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