Skip to content

tests: enforce PHP extension inventories before publishing - #104

Merged
jakubboucek merged 5 commits into
update-phpfrom
php-test-ext
Oct 13, 2026
Merged

jakubboucek merged 5 commits into
update-phpfrom
php-test-ext

Conversation

@jakubboucek

Copy link
Copy Markdown
Owner

This PR responds to Copilot's review of #102: printing the extension list does not fail when a required extension is missing, and individual functional tests can skip unavailable extensions. A mandatory inventory test now fails for both missing and unexpected extensions, including memcached, xdebug, and spx where required.

This PR targets update-php, the branch of #102.

Changes

  • Define expected extensions in a readable NEON configuration: common extensions, cumulative version/variant rules, and explicit exceptions applied last. New PHP versions are evaluated automatically without adding a profile to an allowlist.
  • Support nested all/any conditions, list shorthand for all, version comparisons, and positive/negative variant flags. Reject malformed configuration and conflicting rules; document exceptions and advanced examples.
  • Pass the image reference through IMAGE_NAME and validate it against the runtime PHP version. test-php.sh [tag] tests one image; without arguments it tests all 15 configured variants and reports any failure.
  • Run the same suite in all ten maintained build scripts before publishing, preserving the NO_TEST switch.
  • Pin nette/neon to stable 3.4.8. Its PHP 8.6 behavior was verified despite its declared PHP version constraint ending at 8.5; test dependencies are prepared on the host using the PHP 8.1 Composer platform configuration.

Validation

  • Full suite: 26 tests in each of the 15 PHP 8.2–8.6 base, CLI, and debug images, with existing expected skips.
  • Negative checks: missing/unexpected debug extensions and missing image identity fail the inventory test.
  • Build test phases exercised for all ten scripts with rebuilding and publishing disabled; mocked Docker checks verified that failed tests prevent publishing and NO_TEST bypasses the suite.
  • NEON documentation examples parsed and evaluated against representative version/variant combinations.

Use stable NEON 3.4.8 and validate recursive conditions, exact exceptions and rule conflicts. Derive the variant from DEVSTACK_IMAGE and the version from PHP, without a profile allowlist. Report missing and unexpected modules without skipping the inventory check.

Validated rule behavior for future versions, nested conditions, exceptions and malformed data. Full suites passed in all 15 maintained image variants; negative container probes rejected wrong variants and missing identity. PhpStorm inspections reported no warnings.
Run all configured tags or one requested tag through test-php.sh, passing DEVSTACK_IMAGE and aggregating failures. Invoke the same suite from all maintained PHP build scripts before push, preserving NO_TEST. Mount tooling read-only and document the NEON contract; keep investigation notes ignored.

All ten real build test phases passed with NO_PULL=1 NO_BUILD=1 NO_PUSH=1. Mocked Docker checks confirmed that failed tests prevent any push, successful tests precede push, and NO_TEST bypass works. No images were rebuilt or published.
@jakubboucek
jakubboucek merged commit fa33b30 into update-php Oct 13, 2026
@jakubboucek
jakubboucek deleted the php-test-ext branch October 13, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant