Ship the test-server registry and the docker server classes in caldav.testing

已关闭
#817 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #820 来自 @tobixen —— 已合并

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
docker, python
领域
testing

调研方向

Start by reading caldav.testing and tests/test_servers/ to map the registry, config loader, session locks, and Docker server classes listed in the issue. Then trace how server classes locate docker-test-servers/ and how the existing tests import them. Done means the reusable framework is shipped in caldav.testing, with tests/test_servers re-exporting it and the location of the compose directory resolved.

由索引模型根据 Issue 内容生成。

描述

Disclaimer: AI-generated text below the line, generated by Claude Opus 5.5.


caldav.testing ships the embedded Xandikos and Radicale servers, so other projects can run their tests against them. The rest of the test-server framework is in tests/test_servers/, which is not in the wheel:

  • ServerRegistry, get_available_servers() and the config loader;
  • DockerTestServer and the classes for Baikal, Nextcloud, Cyrus, SOGo and the others;
  • the per-server session locks.

calendaring runs its CalDAV conformance suite on caldav's docker servers (pytest --caldav-servers=Baikal,...). To do so, it loads tests/test_servers by path from a caldav source checkout, under another package name. That works on a laptop, but it has two problems:

  • it breaks whenever caldav's tests are refactored;
  • a CI job has to check out caldav's repository at a matching version, beside the installed package.

Proposal: move the registry, the config loader, the locks and the docker server classes into caldav.testing (or a caldav.testing subpackage), and keep tests/test_servers as a thin re-export so caldav's own tests do not change. The docker-compose files can stay in the repository. A consumer starts the servers from a checkout or as CI service containers, and only needs the classes to find them and know their URLs, credentials and compatibility hints.

Things to settle:

  • Where the docker-test-servers/ directory is found. Today it is found relative to the module, which stops working once the module lives in an installed package. One option is an environment variable, or a config key, naming the checkout. Another is for a shipped class to probe only its URL (is_accessible()) and never try to start anything.
  • No rush. This can wait for a release after 3.6.0; calendaring's path import works locally in the meantime.
主要语言
Python
星标
412
派生
113
平均合并
8 小时 43 分钟
30 天内合并 PR
74

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python-caldav/caldav 的其他 Issue

查看 python-caldav/caldav 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。