WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/26/2021 06:20:24 PM (6 months ago)
Author:
desrosj
Message:

Build/Test Tools: Backport GitHub Action and build improvements to the 5.4 branch.

This backports several build and test tool improvements to the 5.4 branch. Most notably, this includes:

  • The changes required to allow each workflow to be triggered by the workflow_dispatch event so that tests can be run on a schedule [50590].
  • The ability to run PHPUnit tests from src instead of build [50441-50443].
  • Splitting single site and multisite tests into parallel jobs [50379].
  • Split slow tests into separate, parallel jobs for PHP 5.6 [50444].
  • Better branch and path scoping for GitHub Action workflows when running on pull_request [50432,50479].
  • Several devDependency updates.

Merges [50267,50299,50379,50387,50413,50416,50432,50435-50436,50441-50444,50446,50473-50474,50476,50479,50485-50487,50545,50579,50590,50598] to the 5.4 branch.
See #50401, #51734, #51801, #51802, #52548, #52608, #52612, #52623, #52624, #52625, #52645, #52653, #52658, #52660, #52667.

Location:
branches/5.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.4

  • branches/5.4/tests/phpunit/tests/dependencies/scripts.php

    r47416 r50604  
    713713
    714714        $ver       = get_bloginfo( 'version' );
     715        $suffix    = wp_scripts_get_suffix();
    715716        $expected  = "<script type='text/javascript' src='/wp-admin/load-scripts.php?c=0&amp;load%5Bchunk_0%5D=jquery-core,jquery-migrate&amp;ver={$ver}'></script>\n";
    716717        $expected .= "<script type='text/javascript'>\nconsole.log(\"before\");\n</script>\n";
    717718        $expected .= "<script type='text/javascript' src='http://example.com'></script>\n";
    718         $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/vendor/wp-polyfill.min.js'></script>\n";
     719        $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/vendor/wp-polyfill{$suffix}.js'></script>\n";
    719720        $expected .= "<script type='text/javascript'>\n";
    720         $expected .= "( 'fetch' in window ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-fetch.min.js\"></scr' + 'ipt>' );( document.contains ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-node-contains.min.js\"></scr' + 'ipt>' );( window.DOMRect ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-dom-rect.min.js\"></scr' + 'ipt>' );( window.URL && window.URL.prototype && window.URLSearchParams ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-url.min.js\"></scr' + 'ipt>' );( window.FormData && window.FormData.prototype.keys ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-formdata.min.js\"></scr' + 'ipt>' );( Element.prototype.matches && Element.prototype.closest ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-element-closest.min.js\"></scr' + 'ipt>' );\n";
     721        $expected .= "( 'fetch' in window ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-fetch{$suffix}.js\"></scr' + 'ipt>' );( document.contains ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-node-contains{$suffix}.js\"></scr' + 'ipt>' );( window.DOMRect ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-dom-rect{$suffix}.js\"></scr' + 'ipt>' );( window.URL && window.URL.prototype && window.URLSearchParams ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-url{$suffix}.js\"></scr' + 'ipt>' );( window.FormData && window.FormData.prototype.keys ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-formdata{$suffix}.js\"></scr' + 'ipt>' );( Element.prototype.matches && Element.prototype.closest ) || document.write( '<script src=\"http://example.org/wp-includes/js/dist/vendor/wp-polyfill-element-closest{$suffix}.js\"></scr' + 'ipt>' );\n";
    721722        $expected .= "</script>\n";
    722         $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/dom-ready.min.js'></script>\n";
    723         $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/a11y.min.js'></script>\n";
     723        $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/dom-ready{$suffix}.js'></script>\n";
     724        $expected .= "<script type='text/javascript' src='/wp-includes/js/dist/a11y{$suffix}.js'></script>\n";
    724725        $expected .= "<script type='text/javascript' src='http://example2.com'></script>\n";
    725726        $expected .= "<script type='text/javascript'>\nconsole.log(\"after\");\n</script>\n";
     
    13801381        );
    13811382    }
    1382 
    1383     function test_no_source_mapping() {
    1384         $all_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( dirname( ABSPATH ) . '/build/' ) );
    1385         $js_files  = new RegexIterator( $all_files, '/\.js$/' );
    1386         foreach ( $js_files as $js_file ) {
    1387             $contents = trim( file_get_contents( $js_file ) );
    1388 
    1389             // We allow data: URLs.
    1390             $found = preg_match( '/sourceMappingURL=((?!data:).)/', $contents );
    1391             $this->assertSame( $found, 0, "sourceMappingURL found in $js_file" );
    1392         }
    1393     }
    13941383}
Note: See TracChangeset for help on using the changeset viewer.