Make WordPress Core

Changeset 50250 for branches/3.8


Ignore:
Timestamp:
02/08/2021 08:57:54 PM (4 years ago)
Author:
desrosj
Message:

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

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

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

Location:
branches/3.8
Files:
11 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8

  • branches/3.8/package-lock.json

    r50222 r50250  
    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.25",
     
    245281            "dev": true
    246282        },
     283        "axios": {
     284            "version": "0.21.1",
     285            "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
     286            "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
     287            "dev": true,
     288            "requires": {
     289                "follow-redirects": "^1.10.0"
     290            }
     291        },
    247292        "balanced-match": {
    248293            "version": "1.0.0",
     
    836881            }
    837882        },
     883        "dotenv": {
     884            "version": "8.2.0",
     885            "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
     886            "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
     887            "dev": true
     888        },
     889        "dotenv-expand": {
     890            "version": "5.1.0",
     891            "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz",
     892            "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==",
     893            "dev": true
     894        },
    838895        "duplexer": {
    839896            "version": "0.1.2",
     
    11981255            "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
    11991256            "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==",
     1257            "dev": true
     1258        },
     1259        "follow-redirects": {
     1260            "version": "1.13.2",
     1261            "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz",
     1262            "integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==",
    12001263            "dev": true
    12011264        },
     
    23202383            "dev": true
    23212384        },
     2385        "joi": {
     2386            "version": "17.4.0",
     2387            "resolved": "https://registry.npmjs.org/joi/-/joi-17.4.0.tgz",
     2388            "integrity": "sha512-F4WiW2xaV6wc1jxete70Rw4V/VuMd6IN+a5ilZsxG4uYtUXWu2kq9W5P2dz30e7Gmw8RCbY/u/uk+dMPma9tAg==",
     2389            "dev": true,
     2390            "requires": {
     2391                "@hapi/hoek": "^9.0.0",
     2392                "@hapi/topo": "^5.0.0",
     2393                "@sideway/address": "^4.1.0",
     2394                "@sideway/formula": "^3.0.0",
     2395                "@sideway/pinpoint": "^2.0.0"
     2396            }
     2397        },
    23222398        "js-yaml": {
    23232399            "version": "3.14.1",
     
    26402716                "brace-expansion": "^1.1.7"
    26412717            }
     2718        },
     2719        "minimist": {
     2720            "version": "1.2.5",
     2721            "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
     2722            "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
     2723            "dev": true
    26422724        },
    26432725        "mitt": {
     
    36783760            }
    36793761        },
     3762        "tslib": {
     3763            "version": "1.14.1",
     3764            "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
     3765            "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
     3766            "dev": true
     3767        },
    36803768        "tunnel-agent": {
    36813769            "version": "0.6.0",
     
    38363924            }
    38373925        },
     3926        "wait-on": {
     3927            "version": "5.2.1",
     3928            "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-5.2.1.tgz",
     3929            "integrity": "sha512-H2F986kNWMU9hKlI9l/ppO6tN8ZSJd35yBljMLa1/vjzWP++Qh6aXyt77/u7ySJFZQqBtQxnvm/xgG48AObXcw==",
     3930            "dev": true,
     3931            "requires": {
     3932                "axios": "^0.21.1",
     3933                "joi": "^17.3.0",
     3934                "lodash": "^4.17.20",
     3935                "minimist": "^1.2.5",
     3936                "rxjs": "^6.6.3"
     3937            },
     3938            "dependencies": {
     3939                "rxjs": {
     3940                    "version": "6.6.3",
     3941                    "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz",
     3942                    "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==",
     3943                    "dev": true,
     3944                    "requires": {
     3945                        "tslib": "^1.9.0"
     3946                    }
     3947                }
     3948            }
     3949        },
    38383950        "websocket-driver": {
    38393951            "version": "0.7.4",
  • branches/3.8/package.json

    r50222 r50250  
    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",
     
    2931        "grunt-sass": "~3.1.0",
    3032        "matchdep": "~2.0.0",
    31         "sass": "^1.32.6"
     33        "sass": "^1.32.6",
     34        "wait-on": "5.2.1"
     35    },
     36    "scripts": {
     37        "build": "grunt build",
     38        "test": "grunt test",
     39        "watch": "grunt watch",
     40        "grunt": "grunt",
     41        "env:start": "node ./tools/local-env/scripts/start.js",
     42        "env:stop": "node ./tools/local-env/scripts/docker.js down",
     43        "env:restart": "npm run env:stop && npm run env:start",
     44        "env:clean": "node ./tools/local-env/scripts/docker.js down -v --remove-orphans",
     45        "env:reset": "node ./tools/local-env/scripts/docker.js down --rmi all -v --remove-orphans",
     46        "env:install": "node ./tools/local-env/scripts/install.js",
     47        "env:cli": "node ./tools/local-env/scripts/docker.js run cli",
     48        "env:logs": "node ./tools/local-env/scripts/docker.js logs",
     49        "env:pull": "node ./tools/local-env/scripts/docker.js pull",
     50        "test:php": "node ./tools/local-env/scripts/docker.js run --rm phpunit phpunit"
    3251    }
    3352}
  • branches/3.8/tests/phpunit/tests/image/base.php

    r47338 r50250  
    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.8/tests/phpunit/tests/image/editor_gd.php

    r47338 r50250  
    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.8/tests/phpunit/tests/image/editor_imagick.php

    r47338 r50250  
    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.