Skip to content

Misc test fixes#577

Open
swissspidy wants to merge 7 commits into
mainfrom
chore/misc-fixes
Open

Misc test fixes#577
swissspidy wants to merge 7 commits into
mainfrom
chore/misc-fixes

Conversation

@swissspidy

Copy link
Copy Markdown
Collaborator

No description provided.

@swissspidy swissspidy added this to the 0.11.8 milestone Jul 16, 2026
@swissspidy swissspidy added the Testing Issues related with Unit, E2E, Smoke, and other testing requirements/needs label Jul 16, 2026
@swissspidy
swissspidy marked this pull request as ready for review July 16, 2026 12:34
Copilot AI review requested due to automatic review settings July 16, 2026 12:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates AMP-related test fixtures and URL rewriting logic to handle multiple AMP cache hosts (notably ampjs.org) and stabilizes test inputs/outputs across the suite.

Changes:

  • Update AMP video test fixtures to use a more stable Big Buck Bunny MP4 URL.
  • Extend AMP cache host handling to recognize and rewrite both cdn.ampproject.org and ampjs.org, and update RewriteAmpUrls expected outputs (including preloads).
  • Refresh runtime fallback metadata, align PHPCompatibility checks with the project’s PHP minimum, and adjust CI workflow triggering behavior.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/spec/valid-amp/files/Rich_Media_Notifications.html Switches amp-video src to a new sample video host.
tests/spec/valid-amp/files/amp-video.html Updates multiple amp-video src occurrences to the new sample URL.
tests/spec/valid-amp/files/amp-ima-video.html Updates IMA video sources/data-src to the new sample URL.
tests/spec/valid-amp/files/Advanced_Video_Docking.html Updates amp-video src to the new sample URL.
tests/spec/transformers/valid/RewriteAmpUrls/adds_preloads_ampjs/expected_output.html Updates expected rewritten AMP URLs and adds expected preload links.
tests/spec/transformers/valid/RewriteAmpUrls/adds_lts_ampjs/expected_output.html Updates expected LTS rewritten AMP URLs and adds expected preload links.
tests/AmpTest.php Expands runtime-script detection tests to include https://ampjs.org/v0.js.
src/Optimizer/Transformer/RewriteAmpUrls.php Treats multiple AMP cache hosts as rewriteable inputs.
src/Amp.php Introduces CACHE_HOSTS list and extends runtime/viewer script detection to multiple hosts.
resources/local_fallback/rtv/metadata Updates embedded runtime/CSS version metadata for local fallback.
composer.json Updates PHPCompatibility test target version to 7.4 (matching minimum supported PHP).
.github/workflows/test.yml Removes the if: guard from the unit-test job (changes when CI runs).
Comments suppressed due to low confidence (1)

src/Amp.php:74

  • Amp::CACHE_HOSTS now allows both cdn.ampproject.org and ampjs.org, but CACHE_ROOT_URL is still hard-coded to the cdn host. Call sites that gate on CACHE_ROOT_URL (e.g. AutoExtensions.php:197 and Html/Parser/ScriptTag.php:219) will still ignore ampjs.org URLs, leading to inconsistent behavior depending on which code path is used.
     * URL of the AMP cache.
     *
     * @var string
     */
    const CACHE_ROOT_URL = self::CACHE_HOST . '/';

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Optimizer/Transformer/RewriteAmpUrls.php
Comment on lines 184 to +188
if (strpos($url, $host) === 0) {
return $url;
}

foreach (Amp::CACHE_HOSTS as $cacheHost) {
Comment thread src/Optimizer/Transformer/RewriteAmpUrls.php Outdated
Comment thread src/Amp.php
Comment thread src/Amp.php
Comment thread .github/workflows/test.yml
swissspidy and others added 2 commits July 16, 2026 22:42
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testing Issues related with Unit, E2E, Smoke, and other testing requirements/needs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants