Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Caddy Webserver for testing/CI #16093

Open
cmb69 opened this issue Sep 28, 2024 · 0 comments
Open

Setup Caddy Webserver for testing/CI #16093

cmb69 opened this issue Sep 28, 2024 · 0 comments

Comments

@cmb69
Copy link
Member

cmb69 commented Sep 28, 2024

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:

gh release -R caddyserver/caddy download --pattern 'caddy_*_linux_amd64.tar.gz' -O - | sudo tar -xz -C /usr/bin caddy
sudo chmod +x /usr/bin/caddy
sudo caddy start --config ext/curl/tests/Caddyfile

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant