Add a CI smoke test for the self-locating bootstrap in an isolated child process
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- php
- Lĩnh vực
- ci-cd, testing-qa
Hướng nghiên cứu
Start with src/Unit/bootstrap.php and src/Integration/bootstrap.php, then inspect the existing GitHub Actions workflows. Run a smoke test without defining the WPMEDIA_PHPUNIT_* or WP_TESTS_DIR constants, requiring a bootstrap and checking both derived constants. Done means CI runs it on every push, a second bootstrap invocation is safe, and regressions fail loudly.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🤖 AI-generated — created by an automated pipeline. Review before acting on this.
Context
PR #55 (issue #52) made src/Unit/bootstrap.php and src/Integration/bootstrap.php self-locating: when WPMEDIA_PHPUNIT_ROOT_DIR is not already defined, each bootstrap now require_onces src/BootstrapManager.php and calls BootstrapManager::setupConstants('unit'|'integration') to derive the two WPMEDIA_PHPUNIT_* constants. This is the exact code path that runs when PHPUnit re-executes the bootstrap standalone in an isolated @runInSeparateProcess child.
However, the package's own test suite cannot exercise this new branch because its bootstraps go through Tests/{Unit,Integration}/init-tests.php, which pre-defines the constants first. This means the self-derivation branch is validated today only by manual smoke testing, not by CI. A regression (e.g., a wrong relative path in the require_once, or a change to getRootDir()/setupConstants()) could silently break isolated-child consumers without any CI signal.
Dependencies
- Issue #52 / PR #55 (the self-locating changes themselves) — should already be merged
What needs to be done
Add a small CI smoke test script (e.g., a standalone PHP script or harness in a dedicated .github/workflows/ step) that:
- Does NOT pre-define
WPMEDIA_PHPUNIT_ROOT_DIR,WPMEDIA_PHPUNIT_ROOT_TEST_DIR, orWP_TESTS_DIR - Requires the self-locating guard logic from
src/Unit/bootstrap.php(orsrc/Integration/bootstrap.php) - Validates the self-derivation behavior
- Consider also testing a synthetic
vendor/wp-media/phpunitconsumer layout to mirror the real isolated-child scenario
Acceptance Criteria
- CI step (or new workflow) runs the smoke test on every push
- Smoke test confirms both
WPMEDIA_PHPUNIT_ROOT_DIRandWPMEDIA_PHPUNIT_ROOT_TEST_DIRare defined after bootstrap require - No fatal "Undefined constant" errors occur during the smoke test
- A second invocation of the bootstrap short-circuits (no double-define errors under
convertWarningsToExceptions) - CI fails loudly if the self-locating behavior regresses
Additional information
This hardens the #52 behavior so it cannot silently regress. It is not a blocker but strongly improves confidence in the isolated-process bootstrap contract for downstream consumers.
Contributes to #30. Follow-up to #52 / PR #55.
- Ngôn ngữ chính
- PHP
- Star
- 4
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wp-media/phpunit
-
enhancement Made by AI
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
-
wpmedia-phpunit binary breaks @runInSeparateProcess testsCó thể làm lại được @remyperona đã nhận 40 ngày trước và không có pull request nào đang mở. Đang mởbug Made by AI
-
Improve the library to include classes that could be common to all plugins.Có thể làm lại được @hellofromahmed đã nhận 746 ngày trước và không có pull request nào đang mở. Đang mở
-
AdminOnly causes a Notice: Undefined offset in wordpress-develop vars.Có thể làm lại được @hellofromtonya đã nhận 2418 ngày trước và không có pull request nào đang mở. Đang mở
Tất cả issue của wp-media/phpunit
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Automattic/static-site-importer#1879 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
521xueweihan/HelloGitHub#3790 ·
-
[Bug] Feed date, title and author too long to fit inside article box on smaller screens, mobileĐang mởBug (unconfirmed) Good first issue 1️⃣ help wanted UI :art:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
FreshRSS/FreshRSS#9360 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày