php / php/php-src

Setup Caddy Webserver for testing/CI

Ouverte
#16,093 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Category: Tests Extension: curl Feature Status: Needs Triage
Langage dominant
C
Étoiles
40.4k
Forks
8.2k
Merge moyen
2 j 13 h
PR mergées (30 j)
96

Description

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?

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Lisez .github/actions/setup-caddy/action.yml et examinez les quatre tests qui nécessitent Caddy Webserver. Documentez à l’emplacement approprié de la documentation les étapes de configuration de Windows décrites dans l’issue, notamment le Caddyfile personnalisé et la gestion des certificats ; le travail sera considéré comme terminé lorsqu’un développeur Windows pourra reproduire l’environnement de test sans devoir refaire cette investigation.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
php
Domaine
documentation, operating-systems, testing-qa
Type d'issue
Documentation
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.