php / php/php-src

Setup Caddy Webserver for testing/CI

未关闭
#16,093 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Category: Tests Extension: curl Feature Status: Needs Triage
主要语言
C
星标
40.4k
派生
8.2k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

Description

PR #10669 introduced the Caddy Webserver to be able to run the few test cases we have for HTTP/2 Server push. This is used in CI for several jobs, but not for Windows, so I thought I'll have a look. Since I found no further documentation in the code base, I looked at the implementation, and found:

https://github.com/php/php-src/blob/332e9a47ae66ac7db52a66e3bbff3469ef542d0c/.github/actions/setup-caddy/action.yml#L10-L12

Okay, on Windows we're using Chocolatey for some setup, so I checked whether they provide the Caddy Webserver, and found https://community.chocolatey.org/packages/caddy. Unfortunately, they apparently do not provide a way to use a custom Caddyfile, which is required for our test suite.

So I downloaded Caddy Webserver manually, and started it in an elevated shell. A message box popped up asking whether I want to install the local certificate into the trust store; clicked okay. Then I tried a request using curl, but that failed (CRYPT_E_NO_REVOCATION_CHECK). Took me a while to realize that the import into the trust store hadn't actually worked. So finally copy/pasted the local certificate into a cacert.pem file downloaded from the curl Website, and then pointing to this file (curl --cacert). That still did not work for my system curl, which uses Schannel, but fine with our own curl build.

To be able to run the tests, I've then added a respective curl.cainfo option to php.ini, and finally could run the tests.

It might not be worth to integrate this for our Windows CI jobs (after all, there are only 4 tests requiring Caddy Webserver, and HTTP/2 push might be obsolete), but maybe a few lines of documentation would make sense, so (Windows) developers who want/need to look into this don't need to figure out how to setup a test environment for these tests themselves. As I understand it, README files in the test directories are no longer desired; would some documentation in the docs/ folder be more appropriate?

贡献指南

打开贡献指南

从这里开始

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

调研方向

阅读 .github/actions/setup-caddy/action.yml,并检查需要 Caddy Webserver 的四个测试。在适当的文档位置记录 issue 中描述的 Windows 设置步骤,包括自定义 Caddyfile 和证书处理;当 Windows 开发者无需重复此次调查即可复现测试环境时,即视为完成。

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

评估

技术栈
php
领域
documentation, operating-systems, testing-qa
Issue 类型
文档
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

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