Skip to content

Latest commit

 

History

History
88 lines (64 loc) · 3.9 KB

File metadata and controls

88 lines (64 loc) · 3.9 KB

Integration Tests

The repository includes an opt-in Docker-backed integration test suite in tests/container_integration.rs.

Entrypoints

Recommended entrypoint:

./scripts/run-integration-tests.sh

Run both library integration tests and the consumer e2e client suite:

./scripts/run-integration-tests.sh --with-e2e-client

Run only the consumer e2e client suite. This still provisions the complete test stack:

./scripts/run-integration-tests.sh --e2e-only

The script pulls and reports the selected PostgreSQL, Hubuum, and LDAP images before starting the stack. Their defaults are immutable multi-platform image digests. It generates a short-lived test CA and hostname-verified LDAPS certificate, configures the server with the scoped planet-express provider, waits for readiness, optionally applies SQL seed data, and tears everything down in a shell trap unless keep mode is enabled.

Provider coverage discovers the unauthenticated provider list, rejects invalid LDAP credentials, logs in real directory users through both async and blocking clients, verifies synchronized user and group metadata, and exercises settings replace, merge-patch, get, and reset operations as an external user. The fixture configuration lives at tests/container_integration/fixtures/auth-providers.toml.

Mutating integration tests use unique itest-<case>-<ts> resource name prefixes, so they are safe to run with default parallel test threads.

Seed Behavior

  • Default seed file: tests/container_integration/seed/init.sql
  • Custom seed file: ./scripts/run-integration-tests.sh --seed path/to/seed.sql
  • Disable seeding: ./scripts/run-integration-tests.sh --skip-seed

External Stack Mode

Tests can reuse an externally managed stack when both env vars are set:

  • HUBUUM_INTEGRATION_BASE_URL
  • HUBUUM_INTEGRATION_ADMIN_PASSWORD

This is what the wrapper script exports internally before running tests. An external stack must expose the same planet-express provider and fixture users to run the provider-specific tests.

Optional Environment Variables

  • HUBUUM_INTEGRATION_SERVER_IMAGE overrides the server image. By default the wrapper reads the immutable [package.metadata.hubuum].server-image value from Cargo.toml.
  • HUBUUM_INTEGRATION_DB_IMAGE overrides the database image. By default the wrapper and the self-provisioning Rust test stack read the immutable PostgreSQL 18 reference from tests/container_integration/fixtures/postgres/Dockerfile.
  • HUBUUM_INTEGRATION_LDAP_IMAGE overrides the LDAP fixture image.
  • HUBUUM_INTEGRATION_AUTH_CONFIG overrides the server auth-provider configuration file.
  • HUBUUM_INTEGRATION_CONTAINER_RUNTIME forces docker or podman.
  • HUBUUM_INTEGRATION_STACK_TIMEOUT_SECS overrides startup timeout. The default is 300.
  • HUBUUM_INTEGRATION_KEEP_CONTAINERS=1 keeps containers running for debugging.
  • HUBUUM_INTEGRATION_SEED_SQL overrides the default seed SQL file.

Required CI runs integration tests against an immutable server image digest. For client 0.9.0, that image is Hubuum server v0.0.9 at sha256:1f12baf882b6d3df5b4b2dbdf26aad0793274e57f86a2c186b8e1e68632db5db. A scheduled compatibility workflow separately runs against ghcr.io/hubuum/hubuum-server:main, so upstream movement is visible without making otherwise unrelated pull requests nondeterministic.

Dependabot checks the PostgreSQL fixture Dockerfile weekly. Review proposed digest updates for supported linux/amd64 and linux/arm64 manifests and run the canonical combined integration command before merging them. Intentional experiments can still select another tag or digest with HUBUUM_INTEGRATION_DB_IMAGE without changing the repository default.

See the compatibility history for earlier releases and the precise meaning of a declared server target.

If the server image is private in your environment, authenticate first:

docker login ghcr.io