Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#362 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
cli, devops

調査の方向性

.env.default を README の例と比較し、prepare.php の check_required_env() を調べて、ローカルディレクトリの要件を確認してください。WPT_SKIP_DB_CLEANUP と rm -rf の説明を含め、デフォルト値とコメントをドキュメントに記載されたセットアップに合わせて更新してください。データベースの値だけを入力した新しいローカルセットアップで php prepare.php が通り、ファイルが README と一致すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
PHP
スター
77
フォーク
80
平均マージ
12日 17時間
マージ済み PR(30日)
7

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WordPress/phpunit-test-runner のほかの issue

WordPress/phpunit-test-runner の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。