Skip to content

Conversation

@tobixen
Copy link
Member

@tobixen tobixen commented Nov 27, 2025

Set up infrastructure for running tests against Baikal CalDAV server in Docker containers, both locally and in GitHub Actions.

Changes:

  • Added Baikal service container to GitHub Actions workflow
  • Created docker-compose setup under tests/docker-test-servers/baikal/
  • Added Baikal configuration module (tests/conf_baikal.py)
  • Created comprehensive documentation and helper scripts
  • Updated .gitignore to exclude backup directories
  • Added tests/README.md with testing guide

The GitHub Actions workflow now automatically spins up a Baikal container and makes it available at http://localhost:8800 for testing.

🤖 Generated with Claude Code

@tobixen tobixen force-pushed the docker-server-testing-framework branch 2 times, most recently from f20cf30 to 1fd96c6 Compare November 27, 2025 18:24
@cbcoutinho
Copy link

Hey @tobixen, this is a great addition - I've been using a similar pattern in https://github.com/cbcoutinho/nextcloud-mcp-server for integration testing.

Would you be willing to add Nextcloud or Radicale as well for multi-CalDav server testing? I haven't added my docker-compose to #565 to keep the PR focused on httpx, but it's definitely useful - albeit results in longer test times with all the cicd setup

@tobixen
Copy link
Member Author

tobixen commented Nov 28, 2025

Yes, if I can get baikal working, then I will be looking into adding other docker-based calendar servers.

Radicale is not on the list. Radicale and Xandikos is already included in the standard test suite, since they are python-based I was able to launch an instance from the test code without involving docker, so the tests are already running towards radicale regularly.

tobixen and others added 8 commits November 28, 2025 14:53
Set up infrastructure for running tests against Baikal CalDAV server
in Docker containers, both locally and in GitHub Actions.

Changes:
- Added Baikal service container to GitHub Actions workflow
- Created docker-compose setup under tests/docker-test-servers/baikal/
- Added Baikal configuration module (tests/conf_baikal.py)
- Created comprehensive documentation and helper scripts
- Updated .gitignore to exclude backup directories
- Added tests/README.md with testing guide

The GitHub Actions workflow now automatically spins up a Baikal
container and makes it available at http://localhost:8800 for testing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Configure tests to automatically detect and use Baikal CalDAV server
when BAIKAL_URL environment variable is set (as in GitHub Actions).

Changes:
- Added test_baikal flag (auto-enabled when BAIKAL_URL is set)
- Added baikal_host and baikal_port configuration
- Added Baikal server to caldav_servers list if accessible
- Uses compatibility_hints.baikal for known quirks
- Checks if Baikal is accessible before adding to test servers

Tests will now run against the Baikal Docker container in CI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Configure tox to pass BAIKAL_URL, BAIKAL_USERNAME, and BAIKAL_PASSWORD
environment variables to the test environment. Without this, the
environment variables set in GitHub Actions were not reaching the tests.

This enables the test suite to detect and use the Baikal container
in CI/CD pipelines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Configure GitHub Actions to run tests on only the minimum and maximum
supported Python versions (3.9 and 3.14) for pull requests, while still
testing all versions (3.9-3.14) on pushes to master.

This reduces CI time and resource usage for PRs while maintaining full
coverage on the main branch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Create a fully pre-configured Baikal instance that starts ready-to-use
without manual setup, enabling true automated testing in CI/CD.

Changes:
- Added pre-configured SQLite database with testuser/testpass
- Added Baikal config.php and config.system.php files
- Created create_baikal_db.py script to regenerate configuration
- Updated start.sh to copy config into container after startup
- Updated docker-compose.yml to use named volume
- Updated GitHub Actions workflow to copy config into container
- Updated documentation to use start.sh

The Baikal container now starts immediately configured with:
- Admin: admin / admin
- Test user: testuser / testpass
- Default calendar and addressbook already created
- Digest authentication enabled

Local usage: cd tests/docker-test-servers/baikal && ./start.sh
Tests will now run successfully against Baikal in CI/CD.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit implements a complete automated testing framework for Baikal
CalDAV server using Docker containers. The setup works seamlessly in both
local development and CI/CD environments.

Key changes:

1. **Automated container management** (tests/conf.py)
   - Auto-detects docker-compose availability
   - Starts Baikal container automatically when tests run
   - Handles setup/teardown lifecycle
   - Auto-appends /dav.php to base URL for correct CalDAV endpoint

2. **Updated database schema** (tests/docker-test-servers/baikal/create_baikal_db.py)
   - Uses official Baikal 0.10.1 SQLite schema
   - Creates all required tables (groupmembers, calendarinstances, etc.)
   - Properly initializes test user with digest authentication
   - Sets configured_version to match Docker image (0.10.1)

3. **YAML configuration support** (tests/docker-test-servers/baikal/config/baikal.yaml)
   - Added baikal.yaml config for Baikal 0.7.0+ compatibility
   - Configures system settings and database path
   - Enables CalDAV and CardDAV with Digest auth

4. **Improved Docker workflow** (.github/workflows/tests.yaml)
   - Added permission fixes for SQLite database
   - Copies both Specific and config directories
   - Ensures proper file ownership in container

5. **Graceful degradation** (tests/conf.py)
   - Skips Baikal tests if Docker not available
   - Provides clear error messages when misconfigured
   - Works on systems without Docker installed

6. **Updated compatibility hints** (caldav/compatibility_hints.py)
   - Verified compatibility with Baikal 0.10.1
   - Removed obsolete quirks no longer needed
   - Preserved old quirks for reference

7. **Documentation updates** (tests/docker-test-servers/baikal/README.md)
   - Added automatic setup instructions
   - Documented URL handling (/dav.php auto-append)
   - Explained Docker requirement and graceful skip behavior

The framework now supports fully automated testing against Baikal without
any manual configuration. Tests automatically start the container if needed,
or skip gracefully if Docker is unavailable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@tobixen tobixen force-pushed the docker-server-testing-framework branch from e69a622 to befbf61 Compare November 28, 2025 19:44
tobixen and others added 2 commits November 28, 2025 20:47
Documents the new automated Baikal testing framework in the Unreleased
section, including all key features and capabilities.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@tobixen
Copy link
Member Author

tobixen commented Nov 28, 2025

This was a hard nut to crack, I'm happy that I could outsource it to the AI. It was having a really hard time getting the baikal server set up, oscillating between trying to mount some directory pre-seeded with configuration versus copying the configuration into the server after startup. All the time baikal just wanted to redirect to an install script.

@tobixen tobixen merged commit 1d54978 into master Nov 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants