Testing¶
Test suites¶
Local Concourse for integration tests¶
Quick start¶
# 1. Start Concourse (uses the bundled docker-compose.yml)
make concourse-up
# 2. Run the integration tests
make test-integration
# 3. Tear down when done
make concourse-down
The Concourse instance starts at http://localhost:8080 with credentials test / test.
What concourse-up does¶
make concourse-up is shorthand for:
The docker-compose.yml at the repo root is the canonical Concourse quick-start compose file. It starts:
| Service | Purpose |
|---|---|
concourse-db | PostgreSQL database for Concourse state |
concourse | Concourse web + worker in quickstart mode |
Key settings baked in:
| Setting | Value |
|---|---|
| URL | http://localhost:8080 |
| Username | test |
| Password | test |
| Cluster name | tutorial |
| Worker runtime | containerd |
Integration test coverage¶
Tests live under test/integration/ and use the integration build tag so they are excluded from the normal make test run.
| Test group | What it verifies |
|---|---|
| Client connectivity | GetInfo returns version 8.2.1, ListWorkers returns at least one worker |
| Team management | Create a team via CreateOrUpdate, list teams, delete team |
| Pipeline management | Set pipeline config, pause/unpause, delete |
| Resource management | List resource versions, trigger a resource check |
| Build management | Trigger a job build, fetch build status |
Token acquisition¶
The tests obtain a short-lived OAuth bearer token at suite startup using the password grant:
POST http://localhost:8080/sky/issuer/token
grant_type=password
username=test
password=test
client: fly / Y29uY291cnNlLXdlYgo=
This is exactly what fly login does under the hood.
Testing the operator against local Concourse¶
1. Create the credential secret¶
2. Start the operator¶
3. Apply samples¶
The samples reference concourseinstance-sample which points at http://localhost:8080 using the concourse-local-credentials secret. They are ordered such that applying the full directory works without conflicts (Instance → Team → Pipeline → Job / Resource / Worker).
CI workflow¶
The integration tests run automatically on every push and pull request via .github/workflows/test-integration.yml. The workflow:
- Checks out the code.
- Starts Concourse with
docker compose up -d(uses the repo-localdocker-compose.yml). - Polls
/api/v1/infountil Concourse is healthy (up to 120 s). - Runs
make test-integration.
No extra secrets or infrastructure are needed — the compose file is self-contained.