Dagger
Search

tests

standalone dagger function so it can be invoked individually during TDD;
All wires them up for parallel execution under `dagger call all`.

Every password, cluster name, and database name is minted at runtime via
dag.Random().Sha256 — no secret literals enter git. The schema DDL (table and
column names) is fixed test input, not a secret, so it stays inline below.

Installation

dagger install github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453

Entrypoint

Return Type
Tests
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
func (m *MyModule) Example() *dagger.Tests  {
	return dag.
			Tests()
}
@function
def example() -> dagger.Tests:
	return (
		dag.tests()
	)
@func()
example(): Tests {
	return dag
		.tests()
}

Types

Tests 🔗

all() 🔗

All runs every skill-gen test for local dagger call all.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
parallelInteger !0No description provided
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 all --parallel integer
func (m *MyModule) Example(ctx context.Context, parallel int)   {
	return dag.
			Tests().
			All(ctx, parallel)
}
@function
async def example(parallel: int) -> None:
	return await (
		dag.tests()
		.all(parallel)
	)
@func()
async example(parallel: number): Promise<void> {
	return dag
		.tests()
		.all(parallel)
}

generatesPgSkillFromCluster() 🔗

GeneratesPgSkillFromCluster pins the happy path: the full tree is present and fully substituted, the frontmatter is correct and model-invocable, and enums.md exists because the schema defines an enum.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 generates-pg-skill-from-cluster
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Generatespgskillfromcluster(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.generatespgskillfromcluster()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.generatesPgSkillFromCluster()
}

generatesPgSkillOverMtls() 🔗

GeneratesPgSkillOverMtls pins that SkillGen.Postgres introspects a mutual-TLS cluster when handed the server CA plus a client cert/key whose CN matches the role (clientcert=verify-full), producing the full skill tree.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 generates-pg-skill-over-mtls
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Generatespgskillovermtls(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.generatespgskillovermtls()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.generatesPgSkillOverMtls()
}

generatesPgSkillOverTls() 🔗

GeneratesPgSkillOverTls pins that SkillGen.Postgres introspects a one-way-TLS cluster (sslmode=verify-full) when handed only the server CA, producing the full skill tree. The server cert’s SAN must cover the dialed clusterHost.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 generates-pg-skill-over-tls
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Generatespgskillovertls(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.generatespgskillovertls()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.generatesPgSkillOverTls()
}

introspectionFailureAborts() 🔗

IntrospectionFailureAborts pins that an introspection failure (here, a wrong password against a live cluster) aborts with a non-zero error and yields no Directory.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 introspection-failure-aborts
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Introspectionfailureaborts(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.introspectionfailureaborts()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.introspectionFailureAborts()
}

plaintextParamsAgainstTlsAbort() 🔗

PlaintextParamsAgainstTlsAbort pins that introspecting a TLS-required cluster with no cert params (plaintext) aborts: the primary’s hostssl-only pg_hba.conf refuses the unencrypted connection, so generation fails and yields no Directory rather than silently producing partial output.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 plaintext-params-against-tls-abort
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Plaintextparamsagainsttlsabort(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.plaintextparamsagainsttlsabort()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.plaintextParamsAgainstTlsAbort()
}

postgresShouldNotBeCached() 🔗

PostgresShouldNotBeCached pins the non-caching contract: regenerating after a schema change reflects the change rather than serving a stale cached Directory.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 postgres-should-not-be-cached
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Postgresshouldnotbecached(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.postgresshouldnotbecached()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.postgresShouldNotBeCached()
}

regenChangesetEmptyWhenUnchanged() 🔗

RegenChangesetEmptyWhenUnchanged pins byte-stability: two generations over an unchanged schema produce an empty changeset.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 regen-changeset-empty-when-unchanged
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Regenchangesetemptywhenunchanged(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.regenchangesetemptywhenunchanged()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.regenChangesetEmptyWhenUnchanged()
}

regenChangesetReflectsSchemaDrift() 🔗

RegenChangesetReflectsSchemaDrift pins that a schema change yields a non-empty changeset: a new table modifies the references, and adding the first enum adds references/enums.md as a brand-new path.

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 regen-changeset-reflects-schema-drift
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Regenchangesetreflectsschemadrift(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.regenchangesetreflectsschemadrift()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.regenChangesetReflectsSchemaDrift()
}

rejectsInvalidDbName() 🔗

RejectsInvalidDbName pins that a db name violating ^[A-Za-z0-9_-]+$ is rejected before any introspection (no cluster needed — validation precedes the network).

Return Type
Void !
Example
dagger -m github.com/z5labs/devex/daggerverse/skill-gen/tests@a17bf411228ae3d544c7c18bcf08dd04c295d453 call \
 rejects-invalid-db-name
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Tests().
			Rejectsinvaliddbname(ctx)
}
@function
async def example() -> None:
	return await (
		dag.tests()
		.rejectsinvaliddbname()
	)
@func()
async example(): Promise<void> {
	return dag
		.tests()
		.rejectsInvalidDbName()
}