feat: add Phase 4 DinD test templates for HAF apps
Summary
Add composable templates for Docker Compose test environments as part of Phase 4 (HAF App Template Expansion):
New Templates
| Template | Description |
|---|---|
.haf_app_dind_test_variables |
Standard variables for DinD test jobs (directories, compose config, timeouts) |
.haf_app_dind_extract_cache |
Extract sync cache with shm_dir relocation and blockchain handling |
.haf_app_dind_compose_startup |
Create ci.env and start docker-compose services |
.haf_app_dind_wait_for_services |
Wait for PostgreSQL and PostgREST with DNS fix |
.haf_app_dind_compose_teardown |
Collect logs and cleanup after tests |
.haf_app_dind_complete_test |
Complete ready-to-use test template combining all above |
Usage Example
my-test:
extends: .haf_app_dind_complete_test
needs:
- sync
- prepare_haf_image
variables:
APP_SYNC_CACHE_TYPE: "haf_myapp_sync"
APP_CACHE_KEY: "${HAF_COMMIT}_${CI_COMMIT_SHORT_SHA}"
HAF_APP_SCHEMA: "myapp"
script:
- ./run-my-tests.sh --host=docker
Reduces Duplication
These templates consolidate common patterns found in balance_tracker and reputation_tracker test jobs:
- Cache extraction with blockchain symlink/copy logic
- shm_dir relocation for different cache formats
- ci.env file creation for docker-compose
- Service wait loops with DNS resolution fixes
- Log collection and cleanup
Test plan
- Templates are syntactically valid YAML
- Test with balance_tracker migration (follow-up MR)
- Test with reputation_tracker migration (follow-up MR)