Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

.env.default sets WPT_TEST_DIR to a value that stops a local run

Aperta Adatta ai principianti
#362 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php
Ambito
cli, devops

Direzione di ricerca

Confronta .env.default con l’esempio del README ed esamina check_required_env() in prepare.php per confermare il requisito della directory locale. Aggiorna i valori predefiniti e i commenti affinché corrispondano alla configurazione documentata, inclusi WPT_SKIP_DB_CLEANUP e la spiegazione di rm -rf. Il lavoro è completato quando una nuova configurazione locale, in cui sono stati inseriti solo i valori del database, supera php prepare.php e il file corrisponde al README.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
.env.default sets WPT_PREPARE_DIR="/tmp/wp-test-runner" and WPT_TEST_DIR="wp-test-runner". For a local run (WPT_SSH_CONNECT empty), check_required_env() requires the two to be the same, so a host who follows the README stops at prepare.php.

The copy of .env.default printed in the README shows export WPT_TEST_DIR="/tmp/wp-test-runner", so the README and the real file disagree. The real file is also behind the README in two other places:

  • WPT_SKIP_DB_CLEANUP is missing. It was added to functions.php and the README in 6538f85 (#337).
  • The WPT_RM_TEST_DIR_CMD comment still says rm -r. The README copy says rm -rf and explains why -f is needed (dd6d34e, #336).

To Reproduce
Steps to reproduce the behavior:

  1. cp .env.default .env
  2. Set WPT_DB_NAME, WPT_DB_USER, WPT_DB_PASSWORD and WPT_DB_HOST in .env, nothing else.
  3. source .env
  4. php prepare.php
  5. See error:
WPT_PREPARE_DIR=/tmp/wp-test-runner WPT_TEST_DIR=wp-test-runner
Error: WPT_TEST_DIR must be the same as WPT_PREPARE_DIR when running locally.

For the other two points:

$ grep -n "SKIP_DB_CLEANUP" .env.default
$ grep -n "rm -r" .env.default
46:# Use if `rm -r` can't be called directly for some reason.

Expected behavior
A copy of .env.default with only the database values filled in works for a local run, as the README describes. .env.default matches the copy printed in the README: export WPT_TEST_DIR="/tmp/wp-test-runner", the WPT_SKIP_DB_CLEANUP entry, and the rm -rf comment.

Screenshots
n/a (command line output above)

Additional context
Tested on master at 1f276b2 with PHP 8.4.27, in the image built from docker/Dockerfile. The hosting handbook also says WPT_TEST_DIR defaults to $WPT_PREPARE_DIR.

AI Assisted: I used an AI assistant to help investigate and draft this; I ran and checked every test and result myself.

Lingua principale
PHP
Stelle
77
Fork
80
Merge medio
12g 17h
PR unite (30g)
7

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WordPress/phpunit-test-runner

Tutte le issue di WordPress/phpunit-test-runner

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.