What I Do
Guide integration testing with Podman-managed containers for TimescaleDB (PostgreSQL 17) and RabbitMQ 4.1.4.
Container Services
TimescaleDB (crypto-scout-collector-db)
- Image:
timescale/timescaledb:latest-pg17
- Port:
127.0.0.1:5432:5432
- Database:
crypto_scout
- User/Password:
crypto_scout_db / crypto_scout_db
- Schema:
crypto_scout
- Resource Limits: 1 CPU, 2GB RAM
RabbitMQ (crypto-scout-mq)
- Image:
rabbitmq:4.1.4-management
- AMQP Port:
127.0.0.1:5672:5672
- Streams Port:
127.0.0.1:5552:5552
- User/Password:
crypto_scout_mq / crypto_scout_mq
- Default Stream:
bybit-stream
- Resource Limits: 1 CPU, 512MB RAM
Usage in Tests
import com.github.akarazhev.cryptoscout.test.PodmanCompose;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
final class IntegrationTest {
@BeforeAll
static void setUp() {
PodmanCompose.up(); // Starts containers, waits for readiness
}
@AfterAll
static void tearDown() {
PodmanCompose.down(); // Stops containers, removes volumes
}
@Test
void shouldConnectToDatabase() throws Exception {
assertTrue(DBUtils.canConnect());
}
}
Configuration Properties
| Property |
Default |
Description |
podman.compose.cmd |
podman-compose |
Podman Compose binary |
podman.cmd |
podman |
Podman binary |
podman.compose.up.timeout.min |
3 |
Startup timeout (minutes) |
podman.compose.down.timeout.min |
1 |
Shutdown timeout (minutes) |
podman.compose.ready.interval.sec |
2 |
Readiness check interval |
Database Tables
Bybit Spot (11 tables)
crypto_scout.bybit_spot_tickers
crypto_scout.bybit_spot_kline_1m, _5m, _15m, _60m, _240m, _1d
crypto_scout.bybit_spot_public_trade
crypto_scout.bybit_spot_order_book_1, _50, _200, _1000
Bybit Linear (12 tables)
crypto_scout.bybit_linear_tickers
crypto_scout.bybit_linear_kline_1m, _5m, _15m, _60m, _240m, _1d
crypto_scout.bybit_linear_public_trade
crypto_scout.bybit_linear_order_book_1, _50, _200, _1000
crypto_scout.bybit_linear_all_liquidation
Crypto Scout (6 tables)
crypto_scout.cmc_fgi
crypto_scout.cmc_kline_1d, _1w
crypto_scout.bybit_lpl
crypto_scout.btc_price_risk
crypto_scout.btc_risk_price
System Tables (1 table)
crypto_scout.stream_offsets - Stream offset tracking
Total: 30 tables
Resource Files
Located in src/main/resources/podman/:
podman-compose.yml - Service definitions with resource limits
script/init.sql - Database initialization and schema setup
script/bybit_spot_tables.sql - Spot table schemas
script/bybit_linear_tables.sql - Linear table schemas
script/crypto_scout_tables.sql - Crypto scout table schemas
rabbitmq/enabled_plugins - RabbitMQ plugins (streams enabled)
rabbitmq/rabbitmq.conf - RabbitMQ configuration
rabbitmq/definitions.json - RabbitMQ definitions (users, exchanges, queues)
Running Tests
# Standard test run
mvn test
# With extended timeout for slow environments
mvn -q -Dpodman.compose.up.timeout.min=5 test
# Custom database URL
mvn -q -Dtest.db.jdbc.url=jdbc:postgresql://localhost:5432/crypto_scout test
# Run specific test
mvn test -Dtest=StreamConsumerPublisherTest
# Run specific test method
mvn test -Dtest=MockBybitSpotDataTest#shouldSpotKline1DataReturnMap
Troubleshooting
Container not starting
- Verify Podman is installed:
podman --version
- Check podman-compose:
podman-compose --version
- Increase timeout:
-Dpodman.compose.up.timeout.min=10
- Check if ports are already in use:
lsof -i :5432 or lsof -i :5552
Database not reachable
- Confirm port 5432 is free
- Check credentials match defaults
- Verify container is running:
podman ps
- Check database logs:
podman logs crypto-scout-collector-db
RabbitMQ Streams not reachable
- Confirm port 5552 is free
- Check
rabbitmq.conf advertises localhost
- Verify Streams plugin is enabled:
podman exec crypto-scout-mq rabbitmq-plugins list
- Check RabbitMQ logs:
podman logs crypto-scout-mq
Permission issues
- Ensure user can run podman without sudo
- Check SELinux settings if applicable
- Verify podman socket is accessible
PodmanCompose Implementation Details
Container Readiness Checks:
waitForDatabaseReady() - Attempts JDBC connection with retry
waitForMqReady() - Creates temporary RabbitMQ Streams producer
waitForContainerRemoval() - Polls podman ps until containers gone
Resource Extraction:
When running from JAR, extracts podman resources to temp directory:
- Creates temp dir with prefix
crypto-scout-podman-
- Registers shutdown hook for cleanup
- Copies compose file, SQL scripts, and RabbitMQ config
Process Management:
- Uses
ProcessBuilder for podman-compose commands
- Daemon thread for reading process output
- Forcibly destroys process on timeout
- Captures partial output for debugging
When to Use Me
Use this skill when:
- Setting up integration tests with containers
- Troubleshooting container startup issues
- Understanding the test infrastructure
- Configuring Podman for CI/CD environments
- Managing database state between tests
- Adding new SQL initialization scripts
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: podman-testing3description: Podman Compose integration testing patterns for TimescaleDB and RabbitMQ container management Use when this capability is needed.4---56## What I Do78Guide integration testing with Podman-managed containers for TimescaleDB (PostgreSQL 17) and RabbitMQ 4.1.4.910## Container Services1112### TimescaleDB (crypto-scout-collector-db)13- **Image**: `timescale/timescaledb:latest-pg17`14- **Port**: `127.0.0.1:5432:5432`15- **Database**: `crypto_scout`16- **User/Password**: `crypto_scout_db` / `crypto_scout_db`17- **Schema**: `crypto_scout`18- **Resource Limits**: 1 CPU, 2GB RAM1920### RabbitMQ (crypto-scout-mq)21- **Image**: `rabbitmq:4.1.4-management`22- **AMQP Port**: `127.0.0.1:5672:5672`23- **Streams Port**: `127.0.0.1:5552:5552`24- **User/Password**: `crypto_scout_mq` / `crypto_scout_mq`25- **Default Stream**: `bybit-stream`26- **Resource Limits**: 1 CPU, 512MB RAM2728## Usage in Tests2930```java31import com.github.akarazhev.cryptoscout.test.PodmanCompose;32import org.junit.jupiter.api.AfterAll;33import org.junit.jupiter.api.BeforeAll;3435final class IntegrationTest {36 37 @BeforeAll38 static void setUp() {39 PodmanCompose.up(); // Starts containers, waits for readiness40 }41 42 @AfterAll43 static void tearDown() {44 PodmanCompose.down(); // Stops containers, removes volumes45 }46 47 @Test48 void shouldConnectToDatabase() throws Exception {49 assertTrue(DBUtils.canConnect());50 }51}52```5354## Configuration Properties5556| Property | Default | Description |57|----------|---------|-------------|58| `podman.compose.cmd` | `podman-compose` | Podman Compose binary |59| `podman.cmd` | `podman` | Podman binary |60| `podman.compose.up.timeout.min` | `3` | Startup timeout (minutes) |61| `podman.compose.down.timeout.min` | `1` | Shutdown timeout (minutes) |62| `podman.compose.ready.interval.sec` | `2` | Readiness check interval |6364## Database Tables6566### Bybit Spot (11 tables)67- `crypto_scout.bybit_spot_tickers`68- `crypto_scout.bybit_spot_kline_1m`, `_5m`, `_15m`, `_60m`, `_240m`, `_1d`69- `crypto_scout.bybit_spot_public_trade`70- `crypto_scout.bybit_spot_order_book_1`, `_50`, `_200`, `_1000`7172### Bybit Linear (12 tables)73- `crypto_scout.bybit_linear_tickers`74- `crypto_scout.bybit_linear_kline_1m`, `_5m`, `_15m`, `_60m`, `_240m`, `_1d`75- `crypto_scout.bybit_linear_public_trade`76- `crypto_scout.bybit_linear_order_book_1`, `_50`, `_200`, `_1000`77- `crypto_scout.bybit_linear_all_liquidation`7879### Crypto Scout (6 tables)80- `crypto_scout.cmc_fgi`81- `crypto_scout.cmc_kline_1d`, `_1w`82- `crypto_scout.bybit_lpl`83- `crypto_scout.btc_price_risk`84- `crypto_scout.btc_risk_price`8586### System Tables (1 table)87- `crypto_scout.stream_offsets` - Stream offset tracking8889**Total: 30 tables**9091## Resource Files9293Located in `src/main/resources/podman/`:94- `podman-compose.yml` - Service definitions with resource limits95- `script/init.sql` - Database initialization and schema setup96- `script/bybit_spot_tables.sql` - Spot table schemas97- `script/bybit_linear_tables.sql` - Linear table schemas98- `script/crypto_scout_tables.sql` - Crypto scout table schemas99- `rabbitmq/enabled_plugins` - RabbitMQ plugins (streams enabled)100- `rabbitmq/rabbitmq.conf` - RabbitMQ configuration101- `rabbitmq/definitions.json` - RabbitMQ definitions (users, exchanges, queues)102103## Running Tests104105```bash106# Standard test run107mvn test108109# With extended timeout for slow environments110mvn -q -Dpodman.compose.up.timeout.min=5 test111112# Custom database URL113mvn -q -Dtest.db.jdbc.url=jdbc:postgresql://localhost:5432/crypto_scout test114115# Run specific test116mvn test -Dtest=StreamConsumerPublisherTest117118# Run specific test method119mvn test -Dtest=MockBybitSpotDataTest#shouldSpotKline1DataReturnMap120```121122## Troubleshooting123124### Container not starting125- Verify Podman is installed: `podman --version`126- Check podman-compose: `podman-compose --version`127- Increase timeout: `-Dpodman.compose.up.timeout.min=10`128- Check if ports are already in use: `lsof -i :5432` or `lsof -i :5552`129130### Database not reachable131- Confirm port 5432 is free132- Check credentials match defaults133- Verify container is running: `podman ps`134- Check database logs: `podman logs crypto-scout-collector-db`135136### RabbitMQ Streams not reachable137- Confirm port 5552 is free138- Check `rabbitmq.conf` advertises `localhost`139- Verify Streams plugin is enabled: `podman exec crypto-scout-mq rabbitmq-plugins list`140- Check RabbitMQ logs: `podman logs crypto-scout-mq`141142### Permission issues143- Ensure user can run podman without sudo144- Check SELinux settings if applicable145- Verify podman socket is accessible146147## PodmanCompose Implementation Details148149**Container Readiness Checks:**1501. `waitForDatabaseReady()` - Attempts JDBC connection with retry1512. `waitForMqReady()` - Creates temporary RabbitMQ Streams producer1523. `waitForContainerRemoval()` - Polls `podman ps` until containers gone153154**Resource Extraction:**155When running from JAR, extracts podman resources to temp directory:156- Creates temp dir with prefix `crypto-scout-podman-`157- Registers shutdown hook for cleanup158- Copies compose file, SQL scripts, and RabbitMQ config159160**Process Management:**161- Uses `ProcessBuilder` for podman-compose commands162- Daemon thread for reading process output163- Forcibly destroys process on timeout164- Captures partial output for debugging165166## When to Use Me167168Use this skill when:169- Setting up integration tests with containers170- Troubleshooting container startup issues171- Understanding the test infrastructure172- Configuring Podman for CI/CD environments173- Managing database state between tests174- Adding new SQL initialization scripts175176---177> Converted and distributed by [TomeVault](https://tomevault.io/claim/akarazhev) — claim your Tome and manage your conversions.178<!-- tomevault:4.0:skill_md:2026-04-15 -->