Skip to content

Modernize PHP 8 tests and fix extension and FPM provisioning - #579

Merged
Kanti merged 13 commits into
masterfrom
copilot/cleanup-tests-for-php-8-only
Oct 2, 2026
Merged

Kanti merged 13 commits into
masterfrom
copilot/cleanup-tests-for-php-8-only

Conversation

Copilot AI commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

PHP 8 images skipped shared Serverspec checks, and broad version assertions could accept the wrong PHP minor version. This PR restores CLI and FPM coverage for PHP 8.1–8.5 and fixes extension and development FPM provisioning.

Changes

  • Replace PHP 5/7 test branches and collections with shared PHP 8 checks across production and development image variants. Remove legacy fixtures and obsolete opcache.fast_shutdown assertions, preserving applicable configuration, FTP SSL, AVIF, shmop, Redis, and OPcache coverage.
  • Require PHP 8.1 or newer in structure tests. Match CLI and HTTP/HTTPS FPM minor versions to DOCKER_TAG, including Alpine suffixes, while preserving prerelease support.
  • Expand CLI and FPM extension assertions for amqp, imagick, FFI, gmp, excimer, opentelemetry, protobuf, vips, mongodb, and yaml. Also cover installed intl, LDAP, memcached, PostgreSQL, and XML-RPC modules. Keep IMAP checks limited to PHP 8.1–8.3 and share the structure-test module list between CLI and FPM.
  • Install and enable YAML in Debian PHP images, matching existing Alpine support. Retain its runtime library after build cleanup and regenerate the Debian PHP 8.1–8.5 Dockerfiles.
  • Retain the PHP 8.1 IMAP runtime dependency after build cleanup. Update all development FPM configurations to preserve public listening and regenerate provisioning scripts for PHP, Nginx, and Apache development images.
  • Restore relevant final-image assertions for metadata, /app ownership and permissions, utility binaries, removal of completed provisioning scripts, retention of optional service installers, and executable bootstrap helpers. Keep zic Debian-only and use current permissions without duplicating existing coverage.

Validation

  • 207 focused extension Serverspec examples passed, including CLI and FPM checks.
  • 329 focused layout Serverspec examples passed across Debian and Alpine production images and an Alpine development image.
  • All 34 PHP structure checks passed on Debian PHP 8.1, Debian PHP 8.5, and Alpine PHP 8.5: 102 checks total.
  • 92 version-matcher cases passed. Live CLI and HTTP/HTTPS FPM checks accepted matching tags and rejected mismatched minor versions.
  • YAML installation passed incremental Debian PHP 8.1 and 8.5 image builds. Generated Dockerfiles matched their template; Ruby syntax, YAML parsing, and git diff --check passed.

Fixes #577

Copilot AI linked an issue Oct 1, 2026 that may be closed by this pull request
2 tasks
Copilot AI and others added 2 commits October 1, 2026 11:32
Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com>
Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com>
Copilot AI changed the title [WIP] Cleanup tests for PHP 8 only Restrict PHP tests to PHP 8.1+ Oct 1, 2026
Copilot AI requested a review from Kanti October 1, 2026 11:36
Copilot stopped work on behalf of Kanti due to an error October 1, 2026 11:46
Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com>
Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com>
Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com>
Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com>
Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com>
Kanti added 4 commits October 2, 2026 12:13
…ners

Retain libc-client2007e after build cleanup so PHP 8.1 can load IMAP.
Include PHP 8.1 in the dedicated IMAP tests.

Update every development FPM config to preserve public listening.
Prevent later pool configs from restoring the localhost listener.

Regenerate Dockerfiles and provisioning scripts from their sources.
Assert installed PHP extensions in CLI and FPM so missing modules are
detected by Serverspec and structure tests. Keep IMAP version guards and
reuse the structure-test module list for both SAPIs.

Install and enable YAML in Debian PHP images, retain its runtime library
after build cleanup, and regenerate the PHP 8.1-8.5 Dockerfiles.

Validation: 207 focused Serverspec examples and 87 structure checks passed
across Debian PHP 8.1/8.5 and Alpine PHP 8.5.
Derive the expected CLI and FPM versions from DOCKER_TAG so images running
the wrong PHP minor version fail their version checks. Support Alpine tag
suffixes and preserve existing prerelease matching.

Validation: 92 matcher cases passed. Matching and mismatched tags were
verified against Debian PHP 8.1 and Alpine PHP 8.5 through CLI and
HTTP/HTTPS FPM checks.
Restore coverage lost when the PHP 7.2 structure suite was removed.
Check that enabled-service installers are deleted, optional installers
remain in the base PHP image, and bootstrap helpers stay executable.

Keep the zic check Debian-only and use current file permissions without
duplicating assertions already covered by shared Serverspec tests.

Validation: 329 focused Serverspec examples and 102 structure checks passed
on Debian and Alpine, including helper checks on a development image.
@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
15.4% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@Kanti
Kanti marked this pull request as ready for review October 2, 2026 12:47
@Kanti Kanti changed the title Restrict PHP tests to PHP 8.1+ Modernize PHP 8 tests and fix extension and FPM provisioning Oct 2, 2026
@Kanti
Kanti merged commit cd9dd42 into master Oct 2, 2026
218 of 219 checks passed
@Kanti
Kanti deleted the copilot/cleanup-tests-for-php-8-only branch October 2, 2026 13:17
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.

Cleanup Tests for php 8 only

2 participants