|
| 1 | +# Dalli Development Container |
| 2 | + |
| 3 | +This directory contains configuration for a development container that provides a consistent environment for working on Dalli. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- Ruby 3.2 environment with all necessary dependencies |
| 8 | +- Memcached 1.6.34 installed with SASL and TLS support, matching the GitHub Actions CI environment |
| 9 | +- Configuration for testing, including SASL authentication setup |
| 10 | +- VS Code extensions for Ruby development |
| 11 | + |
| 12 | +## Setup Process |
| 13 | + |
| 14 | +When the container is built and started, the following setup occurs: |
| 15 | + |
| 16 | +1. The container is built with necessary dependencies but without memcached |
| 17 | +2. The `setup.sh` script runs after the container is created which: |
| 18 | + - Installs memcached 1.6.34 using the same script used in GitHub Actions |
| 19 | + - Configures SASL authentication for testing |
| 20 | + - Sets up environment variables needed for tests |
| 21 | + - Installs gem dependencies |
| 22 | + |
| 23 | +## Running Tests |
| 24 | + |
| 25 | +Once the container is running, you can run tests with: |
| 26 | + |
| 27 | +```bash |
| 28 | +bundle exec rake test |
| 29 | +``` |
| 30 | + |
| 31 | +To run specific test files: |
| 32 | + |
| 33 | +```bash |
| 34 | +bundle exec ruby -Ilib:test test/path/to/test_file.rb |
| 35 | +``` |
| 36 | + |
| 37 | +## Troubleshooting |
| 38 | + |
| 39 | +If you encounter issues with tests: |
| 40 | + |
| 41 | +1. Verify memcached is running: `ps aux | grep memcached` |
| 42 | +2. Check memcached version: `memcached -h | head -1` |
| 43 | +3. Verify SASL is configured: `cat /usr/lib/sasl2/memcached.conf` |
| 44 | +4. Try restarting memcached: `sudo service memcached restart` |
| 45 | +5. Check logs for any errors: `sudo journalctl -u memcached` |
| 46 | + |
| 47 | +## Port Forwarding |
| 48 | + |
| 49 | +The following memcached ports are forwarded for testing: |
| 50 | +- 11211 - Default memcached port |
| 51 | +- 11212-11215 - Additional ports used by tests |
| 52 | + |
| 53 | +## Environment Variables |
| 54 | + |
| 55 | +- `RUN_SASL_TESTS=1` - Enables SASL authentication tests |
0 commit comments