README
¶
Identity Integration Tests
Identity now has a single main integration suite: test/api.
The suite can run in two modes:
- Per-PR kind CI: the GitHub Actions integration workflow creates a fresh KinD cluster,
deploys identity, creates fixtures, and runs
make test-api-ci. - Manual / triggered mode: provide
test/.envyourself and run the sametest/apisuite against an existing environment.
This keeps one test suite and two execution modes, rather than maintaining separate api and
e2e test trees.
Current Execution Modes
Per-PR kind CI
The integration workflow in
../.github/workflows/integration.yaml
runs on every pull request and executes:
make kind-cluster
make integration-infra
make integration-install
make integration-fixtures
make test-api-ci
In practice the workflow invokes the underlying scripts directly, but the behaviour is the same:
- create an isolated KinD cluster
- install cert-manager, ingress-nginx, and unikorn-core
- deploy identity with a random namespace and release name
- create fixtures via mTLS
- write
test/.env - run the main
test/apisuite
Manual / triggered mode
This mode is for developers or manually triggered jobs that point at an existing environment.
Create test/.env yourself and run:
make test-api
Required variables:
IDENTITY_BASE_URLAPI_AUTH_TOKENTEST_ORG_IDTEST_PROJECT_ID
Optional variables for richer coverage:
ADMIN_AUTH_TOKENUSER_AUTH_TOKENTEST_USER_SA_IDIDENTITY_CA_CERTPLATFORM_ADMIN_AUTH_TOKEN— user token bound via legacyplatformAdministrators.subjectsBINDING_ADMIN_AUTH_TOKEN— user token bound viaglobalRoleBindings; also carries the globalidentity:oauth2providerswrites no organization role holds, so the oauth2provider write specs skip without it.PLATFORM_READER_AUTH_TOKEN— token for a subject bound to the protectedplatform-readerrole via an exactuniglobal role binding; the platform-reader suite skips without it.TEST_PLATFORM_READER_ROLE_ID— Role CRD ID ofplatform-reader, resolved by the fixtures from the cluster (protected roles are invisible via the API); the non-grantability test skips without it.ACL_CACHE_TIMEOUT— the server's--acl-cache-timeout(default1m). Specs that revoke a permission wait this long afterwards, so no replica is still serving a cached ACL that allows it.
Notes:
API_AUTH_TOKENremains the backward-compatible input for the main suite.ADMIN_AUTH_TOKENis also accepted and is used by the KinD fixture flow.- When
IDENTITY_CA_CERTis set, the Make targets exportSSL_CERT_FILEso Go HTTP clients trust the test CA issued by the KinD environment. - Specs that install custom resources with no write API — roles, and groups carrying them — need
cluster access via
KUBECONFIG. They discover the identity and organization namespaces fromTEST_ORG_ID, and skip when no kubeconfig is configured (an HTTP-API-only run); a present but brokenKUBECONFIGfails fast.
Local KinD Flow
For local kind or Colima usage, use the guide in
../docs/integration-testing.md.
The recommended local command sequence is:
make integration-install integration-fixtures test-api-ci
Or all at once on KinD:
make integration-test
Load Test
A manually triggered workflow, "Load Test", drives identity's hot paths in a throwaway kind cluster
and gates on how many API-server calls identity makes per request. See
load/README.md.
Upgrade Path
The repository is in a transition from multiple test entry points toward one main way of running integration coverage.
Current state:
- PR validation uses a fresh kind-backed deployment and runs
test/api - manual and legacy jobs can still provide
test/.envand runtest/api - cluster creation remains
kind-cluster; deployment and fixtures use neutralintegration-*names
Target state:
test/apiis the only integration suite- local development, PR CI, and manually triggered jobs all execute the same suite
- kind-backed deployment becomes the default execution model wherever practical
- remaining legacy naming is removed once downstream jobs have migrated