Make WordPress Core

Changeset 50251


Ignore:
Timestamp:
02/08/2021 08:58:53 PM (6 years ago)
Author:
desrosj
Message:

Build/Test Tools: Backport the local Docker environment to the 3.7 branch.

This commit introduces the Docker-based local WordPress development environment to the 3.7 branch.

Merges [44176,45445,45745,45762,45783-45784,45800,45819,45885,46320,46999,47225,47912,48121,49267,49335,49358,49360,49362] to the 3.7 branch.
See #47767.
Fixes #48301.

Location:
branches/3.7
Files:
11 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7

  • branches/3.7/package-lock.json

    r50224 r50251  
    55        "requires": true,
    66        "dependencies": {
     7                "@hapi/hoek": {
     8                        "version": "9.1.1",
     9                        "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.1.1.tgz",
     10                        "integrity": "sha512-CAEbWH7OIur6jEOzaai83jq3FmKmv4PmX1JYfs9IrYcGEVI/lyL1EXJGCj7eFVJ0bg5QR8LMxBlEtA+xKiLpFw==",
     11                        "dev": true
     12                },
     13                "@hapi/topo": {
     14                        "version": "5.0.0",
     15                        "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.0.0.tgz",
     16                        "integrity": "sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw==",
     17                        "dev": true,
     18                        "requires": {
     19                                "@hapi/hoek": "^9.0.0"
     20                        }
     21                },
     22                "@sideway/address": {
     23                        "version": "4.1.1",
     24                        "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.1.tgz",
     25                        "integrity": "sha512-+I5aaQr3m0OAmMr7RQ3fR9zx55sejEYR2BFJaxL+zT3VM2611X0SHvPWIbAUBZVTn/YzYKbV8gJ2oT/QELknfQ==",
     26                        "dev": true,
     27                        "requires": {
     28                                "@hapi/hoek": "^9.0.0"
     29                        }
     30                },
     31                "@sideway/formula": {
     32                        "version": "3.0.0",
     33                        "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz",
     34                        "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==",
     35                        "dev": true
     36                },
     37                "@sideway/pinpoint": {
     38                        "version": "2.0.0",
     39                        "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
     40                        "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==",
     41                        "dev": true
     42                },
    743                "@types/node": {
    844                        "version": "14.14.22",
     
    235271                        "dev": true
    236272                },
     273                "axios": {
     274                        "version": "0.21.1",
     275                        "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
     276                        "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
     277                        "dev": true,
     278                        "requires": {
     279                                "follow-redirects": "^1.10.0"
     280                        }
     281                },
    237282                "balanced-match": {
    238283                        "version": "1.0.0",
     
    680725                        "dev": true
    681726                },
     727                "dotenv": {
     728                        "version": "8.2.0",
     729                        "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
     730                        "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
     731                        "dev": true
     732                },
     733                "dotenv-expand": {
     734                        "version": "5.1.0",
     735                        "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz",
     736                        "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==",
     737                        "dev": true
     738                },
    682739                "duplexer": {
    683740                        "version": "0.1.2",
     
    10361093                        "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
    10371094                        "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
     1095                        "dev": true
     1096                },
     1097                "follow-redirects": {
     1098                        "version": "1.13.2",
     1099                        "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz",
     1100                        "integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==",
    10381101                        "dev": true
    10391102                },
     
    20572120                        "dev": true
    20582121                },
     2122                "joi": {
     2123                        "version": "17.4.0",
     2124                        "resolved": "https://registry.npmjs.org/joi/-/joi-17.4.0.tgz",
     2125                        "integrity": "sha512-F4WiW2xaV6wc1jxete70Rw4V/VuMd6IN+a5ilZsxG4uYtUXWu2kq9W5P2dz30e7Gmw8RCbY/u/uk+dMPma9tAg==",
     2126                        "dev": true,
     2127                        "requires": {
     2128                                "@hapi/hoek": "^9.0.0",
     2129                                "@hapi/topo": "^5.0.0",
     2130                                "@sideway/address": "^4.1.0",
     2131                                "@sideway/formula": "^3.0.0",
     2132                                "@sideway/pinpoint": "^2.0.0"
     2133                        }
     2134                },
    20592135                "js-yaml": {
    20602136                        "version": "3.14.1",
     
    23612437                                "brace-expansion": "^1.1.7"
    23622438                        }
     2439                },
     2440                "minimist": {
     2441                        "version": "1.2.5",
     2442                        "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
     2443                        "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
     2444                        "dev": true
    23632445                },
    23642446                "mitt": {
     
    33633445                        }
    33643446                },
     3447                "tslib": {
     3448                        "version": "1.14.1",
     3449                        "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
     3450                        "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
     3451                        "dev": true
     3452                },
    33653453                "tunnel-agent": {
    33663454                        "version": "0.6.0",
     
    35213609                        }
    35223610                },
     3611                "wait-on": {
     3612                        "version": "5.2.1",
     3613                        "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-5.2.1.tgz",
     3614                        "integrity": "sha512-H2F986kNWMU9hKlI9l/ppO6tN8ZSJd35yBljMLa1/vjzWP++Qh6aXyt77/u7ySJFZQqBtQxnvm/xgG48AObXcw==",
     3615                        "dev": true,
     3616                        "requires": {
     3617                                "axios": "^0.21.1",
     3618                                "joi": "^17.3.0",
     3619                                "lodash": "^4.17.20",
     3620                                "minimist": "^1.2.5",
     3621                                "rxjs": "^6.6.3"
     3622                        },
     3623                        "dependencies": {
     3624                                "rxjs": {
     3625                                        "version": "6.6.3",
     3626                                        "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz",
     3627                                        "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==",
     3628                                        "dev": true,
     3629                                        "requires": {
     3630                                                "tslib": "^1.9.0"
     3631                                        }
     3632                                }
     3633                        }
     3634                },
    35233635                "websocket-driver": {
    35243636                        "version": "0.7.4",
  • branches/3.7/package.json

    r50224 r50251  
    1414        "license": "GPLv2 or later",
    1515        "devDependencies": {
     16                "dotenv": "^8.2.0",
     17                "dotenv-expand": "^5.1.0",
    1618                "grunt": "~1.3.0",
    1719                "grunt-contrib-clean": "~2.0.0",
     
    2527                "grunt-legacy-util": "^2.0.0",
    2628                "grunt-patch-wordpress": "~3.0.0",
    27                 "matchdep": "~2.0.0"
     29                "matchdep": "~2.0.0",
     30                "wait-on": "5.2.1"
     31        },
     32        "scripts": {
     33                "build": "grunt build",
     34                "test": "grunt test",
     35                "watch": "grunt watch",
     36                "grunt": "grunt",
     37                "env:start": "node ./tools/local-env/scripts/start.js",
     38                "env:stop": "node ./tools/local-env/scripts/docker.js down",
     39                "env:restart": "npm run env:stop && npm run env:start",
     40                "env:clean": "node ./tools/local-env/scripts/docker.js down -v --remove-orphans",
     41                "env:reset": "node ./tools/local-env/scripts/docker.js down --rmi all -v --remove-orphans",
     42                "env:install": "node ./tools/local-env/scripts/install.js",
     43                "env:cli": "node ./tools/local-env/scripts/docker.js run cli",
     44                "env:logs": "node ./tools/local-env/scripts/docker.js logs",
     45                "env:pull": "node ./tools/local-env/scripts/docker.js pull",
     46                "test:php": "node ./tools/local-env/scripts/docker.js run --rm phpunit phpunit"
    2847        }
    2948}
  • branches/3.7/src

  • branches/3.7/tests/phpunit/tests/image/base.php

    r47343 r50251  
    3838
    3939        /**
    40          * Helper assertion for testing alpha on images
     40         * Helper assertion for testing alpha on images using GD library
    4141         *
    4242         * @param  string $image_path
     
    4444         * @param  int $alpha
    4545         */
    46         protected function assertImageAlphaAtPoint( $image_path, $point, $alpha ) {
     46        protected function assertImageAlphaAtPointGD( $image_path, $point, $alpha ) {
    4747
    4848                $im = imagecreatefrompng( $image_path );
     
    5353                $this->assertEquals( $alpha, $colors['alpha'] );
    5454        }
     55
     56        /**
     57         * Helper assertion for testing alpha on images using Imagick
     58         *
     59         * @param string $image_path
     60         * @param array $point      array(x,y)
     61         * @param int $expected
     62         */
     63        protected function assertImageAlphaAtPointImagick( $image_path, $point, $expected ) {
     64                $im = new Imagick( $image_path );
     65                $pixel = $im->getImagePixelColor( $point[0], $point[1] );
     66                $color = $pixel->getColorValue( imagick::COLOR_ALPHA );
     67                $this->assertEquals( $expected, $color );
     68        }
    5569}
  • branches/3.7/tests/phpunit/tests/image/editor_gd.php

    r47343 r50251  
    3333        /**
    3434         * Check support for GD compatible mime types.
    35          * 
     35         *
    3636         */
    3737        public function test_supports_mime_type() {
     
    4545        /**
    4646         * Test resizing an image, not using crop
    47          * 
     47         *
    4848         */
    4949        public function test_resize() {
     
    6161        /**
    6262         * Test resizing an image including cropping
    63          * 
     63         *
    6464         */
    6565        public function test_resize_and_crop() {
     
    133133        /**
    134134         * Test the image created with WP_Image_Edior_GD preserves alpha when resizing
    135          * 
     135         *
    136136         * @ticket 23039
    137137         */
     
    144144                $editor->resize(5,5);
    145145                $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
    146                
     146
    147147                $editor->save( $save_to_file );
    148148
    149                 $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
     149                $this->assertImageAlphaAtPointGD( $save_to_file, array( 0,0 ), 127 );
    150150
    151151                unlink( $save_to_file );
    152152        }
    153        
     153
    154154        /**
    155155         * Test the image created with WP_Image_Edior_GD preserves alpha with no resizing etc
    156          * 
     156         *
    157157         * @ticket 23039
    158158         */
     
    165165
    166166                $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
    167                
     167
    168168                $editor->save( $save_to_file );
    169169
    170                 $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
     170                $this->assertImageAlphaAtPointGD( $save_to_file, array( 0,0 ), 127 );
    171171
    172172                unlink( $save_to_file );
  • branches/3.7/tests/phpunit/tests/image/editor_imagick.php

    r47343 r50251  
    3939        /**
    4040         * Check support for Image Magick compatible mime types.
    41          * 
     41         *
    4242         */
    4343        public function test_supports_mime_type() {
     
    5252        /**
    5353         * Test resizing an image, not using crop
    54          * 
     54         *
    5555         */
    5656        public function test_resize() {
     
    6868        /**
    6969         * Test resizing an image including cropping
    70          * 
     70         *
    7171         */
    7272        public function test_resize_and_crop() {
     
    151151                $editor->resize(5,5);
    152152                $save_to_file = tempnam( get_temp_dir(), '' ) . '.png';
    153                
     153
    154154                $editor->save( $save_to_file );
    155155
    156                 $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
     156                $im = new Imagick( $save_to_file );
     157                $pixel = $im->getImagePixelColor( 0, 0 );
     158                $expected = $pixel->getColorValue( imagick::COLOR_ALPHA );
     159
     160                $this->assertImageAlphaAtPointImagick( $save_to_file, array( 0,0 ), $expected );
    157161
    158162                unlink( $save_to_file );
    159163        }
    160        
     164
    161165        /**
    162166         * Test the image created with WP_Image_Edior_Imagick preserves alpha with no resizing etc
     
    175179                $editor->save( $save_to_file );
    176180
    177                 $this->assertImageAlphaAtPoint( $save_to_file, array( 0,0 ), 127 );
     181                $im = new Imagick( $save_to_file );
     182                $pixel = $im->getImagePixelColor( 0, 0 );
     183                $expected = $pixel->getColorValue( imagick::COLOR_ALPHA );
     184
     185                $this->assertImageAlphaAtPointImagick( $save_to_file, array( 0,0 ), $expected );
    178186
    179187                unlink( $save_to_file );
Note: See TracChangeset for help on using the changeset viewer.