From 379c0581bafd1c70711fba9af7287273fa245b5c Mon Sep 17 00:00:00 2001 From: Aaron Feledy Date: Tue, 7 Jan 2025 13:23:39 -0600 Subject: [PATCH] update composer tests --- docs/config.md | 28 ++++++++++++++-------------- docs/index.md | 6 +++--- examples/5.6/README.md | 4 ++-- examples/7.0/README.md | 4 ++-- examples/7.1/README.md | 4 ++-- examples/7.2/README.md | 4 ++-- examples/7.3/.lando.yml | 2 -- examples/7.3/README.md | 4 ++-- examples/7.4/.lando.yml | 1 - examples/8.0/.lando.yml | 2 -- examples/8.0/README.md | 7 ++----- examples/8.1/.lando.yml | 2 -- examples/8.1/README.md | 7 ++----- examples/8.2/.lando.yml | 2 -- examples/8.2/README.md | 7 ++----- examples/8.3/.lando.yml | 2 -- examples/8.3/README.md | 7 ++----- examples/8.4/.lando.yml | 2 -- examples/8.4/README.md | 7 ++----- examples/composer/.lando.yml | 21 ++++++++++++--------- examples/composer/README.md | 3 +++ 21 files changed, 52 insertions(+), 74 deletions(-) diff --git a/docs/config.md b/docs/config.md index 7c7e618..b3ada41 100644 --- a/docs/config.md +++ b/docs/config.md @@ -40,8 +40,8 @@ Like with `apache`, `nginx` will use the the default version of our [nginx](http ```yaml services: myservice: - type: php - via: apache + type: php:8.4 + via: apache:2.4 ``` #### With nginx @@ -49,8 +49,8 @@ services: ```yaml services: myservice: - type: php - via: nginx + type: php:8.4 + via: nginx:1.27 ``` #### As CLI @@ -58,7 +58,7 @@ services: ```yaml services: myservice: - type: php + type: php:8.4 via: cli ``` @@ -67,7 +67,7 @@ In CLI mode you can optionally tell the php cli service to boot up with an arbit ```yaml services: myservice: - type: php + type: php:8.4 via: cli command: php /app/src/artisan horizon ``` @@ -79,8 +79,8 @@ By default Lando will serve the app from the root of your repo. If you'd like to ```yaml services: myservice: - type: php - via: nginx + type: php:8.4 + via: nginx:1.27 webroot: docroot ``` @@ -93,7 +93,7 @@ If you are using `xdebug` version 3, which is installed by default for `php` 7.2 ```yaml services: myservice: - type: php:7.4 + type: php:8.4 xdebug: "debug,develop" ``` @@ -106,7 +106,7 @@ If you'd like to override Lando's out of the box `xdebug` config the easiest way ```yaml services: myservice: - type: php:7.4 + type: php:8.4 xdebug: "debug,develop" overrides: environment: @@ -120,7 +120,7 @@ You can also modify or unset `XDEBUG_MODE` in a similar way. For example if you ```yaml services: myservice: - type: php:7.4 + type: php:8.4 xdebug: true overrides: environment: @@ -215,7 +215,7 @@ An example of globally installing `phpunit/phpunit` `^6.5` is shown below: ```yaml services: myservice: - type: php + type: php:8.4 composer: phpunit/phpunit: ^6.5 ``` @@ -225,7 +225,7 @@ An example of using a [build step](https://docs.lando.dev/services/lando-3.html# ```yaml services: myservice: - type: php + type: php:8.4 build: - composer install ``` @@ -259,7 +259,7 @@ Note that you can put your configuration files anywhere inside your application ```yaml services: myservice: - type: php + type: php:8.4 config: php: config/php.ini server: config/nginx.conf diff --git a/docs/index.md b/docs/index.md index 45240e5..e185db4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,14 +13,14 @@ You can easily add it to your Lando app by adding an entry to the [services](htt ```yaml services: myservice: - type: php:8.0 - via: nginx + type: php:8.4 + via: nginx:1.27 webroot: www ``` ## Supported versions -* [8.4RC2](https://hub.docker.com/r/devwithlando/php) (experimental) +* [8.4](https://hub.docker.com/r/devwithlando/php) * [8.3](https://hub.docker.com/r/devwithlando/php) * [8.2](https://hub.docker.com/r/devwithlando/php) * [8.1](https://hub.docker.com/r/devwithlando/php) diff --git a/examples/5.6/README.md b/examples/5.6/README.md index 799ce38..89bf257 100644 --- a/examples/5.6/README.md +++ b/examples/5.6/README.md @@ -112,8 +112,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should use preinstalled composer 1.x when composer_version is false -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 1." +# Should not install composer when composer_version is false +echo $(lando exec cliworker -- composer --version --no-ansi 2>&1) | grep "executable file not found" ``` ## Destroy tests diff --git a/examples/7.0/README.md b/examples/7.0/README.md index 16b4a96..8df1881 100644 --- a/examples/7.0/README.md +++ b/examples/7.0/README.md @@ -113,8 +113,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should install the latest composer 1.x when composer_version is false -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 1." +# Should not install composer when composer_version is false +lando exec cliworker -- composer --version --no-ansi 2>&1 | grep "executable file not found" # Should have node14 installed in cli service lando node -v | grep v14. diff --git a/examples/7.1/README.md b/examples/7.1/README.md index 5729120..20ca800 100644 --- a/examples/7.1/README.md +++ b/examples/7.1/README.md @@ -113,8 +113,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should install the latest composer 1.x if composer_version is set to false -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 1." +# Should not install composer when composer_version is false +lando exec cliworker -- composer --version --no-ansi 2>&1 | grep "executable file not found" # Should have node14 installed in cli service lando node -v | grep v14. diff --git a/examples/7.2/README.md b/examples/7.2/README.md index 67910df..a36ab21 100644 --- a/examples/7.2/README.md +++ b/examples/7.2/README.md @@ -113,8 +113,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should install the latest composer 1.x if composer_version is set to false -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 1." +# Should not install composer when composer_version is false +lando exec cliworker -- composer --version --no-ansi 2>&1 | grep "executable file not found" # Should have node14 installed in cli service lando node -v | grep v14. diff --git a/examples/7.3/.lando.yml b/examples/7.3/.lando.yml index d710e30..d3661c6 100644 --- a/examples/7.3/.lando.yml +++ b/examples/7.3/.lando.yml @@ -5,10 +5,8 @@ events: services: defaults: type: php:7.3 - composer_version: false cli: type: php:7.3 - composer_version: false via: cli build_as_root: - curl -sL https://deb.nodesource.com/setup_14.x | bash - diff --git a/examples/7.3/README.md b/examples/7.3/README.md index b8fd81d..7dd6ea4 100644 --- a/examples/7.3/README.md +++ b/examples/7.3/README.md @@ -110,8 +110,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should install the composer 2.x using the false flag -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." +# Should not install composer when composer_version is false +lando exec cliworker -- composer --version --no-ansi 2>&1 | grep "executable file not found" # Should have node14 installed in cli service lando node -v | grep v14. diff --git a/examples/7.4/.lando.yml b/examples/7.4/.lando.yml index 1c06da6..044ad53 100644 --- a/examples/7.4/.lando.yml +++ b/examples/7.4/.lando.yml @@ -5,7 +5,6 @@ events: services: defaults: type: php:7.4 - composer_version: false cli: type: php:7.4 composer_version: 1-latest diff --git a/examples/8.0/.lando.yml b/examples/8.0/.lando.yml index dc61acc..23b5d01 100644 --- a/examples/8.0/.lando.yml +++ b/examples/8.0/.lando.yml @@ -5,10 +5,8 @@ events: services: defaults: type: php:8.0 - composer_version: false cli: type: php:8.0 - composer_version: false via: cli build_as_root: - curl -sL https://deb.nodesource.com/setup_14.x | bash - diff --git a/examples/8.0/README.md b/examples/8.0/README.md index b2ddbdf..cbe82a6 100644 --- a/examples/8.0/README.md +++ b/examples/8.0/README.md @@ -74,9 +74,6 @@ lando exec custom -- php -m | grep "xdebug" # Should not serve port 80 for cli lando exec cli -- curl http://localhost || echo $? | grep 7 -# Should install the composer 2.x using the false flag -lando exec cli -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." - # Should use custom php ini if specified lando exec custom -- php -i | grep memory_limit | grep 514 lando exec custom -- curl http://custom_nginx | grep html_errors | grep On | grep On @@ -110,8 +107,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should install the latest composer 2.x by default. -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." +# Should not install composer when composer_version is false +lando exec cliworker -- composer --version --no-ansi 2>&1 | grep "executable file not found" # Should have node14 installed in cli service lando node -v | grep v14. diff --git a/examples/8.1/.lando.yml b/examples/8.1/.lando.yml index 36917c1..fc0be21 100644 --- a/examples/8.1/.lando.yml +++ b/examples/8.1/.lando.yml @@ -5,10 +5,8 @@ events: services: defaults: type: php:8.1 - composer_version: false cli: type: php:8.1 - composer_version: false via: cli build_as_root: - curl -sL https://deb.nodesource.com/setup_14.x | bash - diff --git a/examples/8.1/README.md b/examples/8.1/README.md index dca9524..cbb71f3 100644 --- a/examples/8.1/README.md +++ b/examples/8.1/README.md @@ -74,9 +74,6 @@ lando exec custom -- php -m | grep "xdebug" # Should not serve port 80 for cli lando exec cli -- curl http://localhost || echo $? | grep 7 -# Should install the composer 2.x using the false flag -lando exec cli -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." - # Should use custom php ini if specified lando exec custom -- php -i | grep memory_limit | grep 514 lando exec custom -- curl http://custom_nginx | grep html_errors | grep On | grep On @@ -110,8 +107,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should install the latest composer 2.x by default. -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." +# Should not install composer when composer_version is false +lando exec cliworker -- composer --version --no-ansi 2>&1 | grep "executable file not found" # Should have node14 installed in cli service lando node -v | tee >(cat 1>&2) | grep v18. diff --git a/examples/8.2/.lando.yml b/examples/8.2/.lando.yml index c100081..f70ff13 100644 --- a/examples/8.2/.lando.yml +++ b/examples/8.2/.lando.yml @@ -5,10 +5,8 @@ events: services: defaults: type: php:8.2 - composer_version: false cli: type: php:8.2 - composer_version: false via: cli build_as_root: - curl -sL https://deb.nodesource.com/setup_14.x | bash - diff --git a/examples/8.2/README.md b/examples/8.2/README.md index b293a52..224baac 100644 --- a/examples/8.2/README.md +++ b/examples/8.2/README.md @@ -74,9 +74,6 @@ lando exec custom -- php -m | grep "xdebug" # Should not serve port 80 for cli lando exec cli -- curl http://localhost || echo $? | grep 7 -# Should install the composer 2.x using the false flag -lando exec cli -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." - # Should use custom php ini if specified lando exec custom -- php -i | grep memory_limit | grep 514 lando exec custom -- curl http://custom_nginx | grep html_errors | grep On | grep On @@ -110,8 +107,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should install the latest composer 2.x by default. -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." +# Should not install composer when composer_version is false +lando exec cliworker -- composer --version --no-ansi 2>&1 | grep "executable file not found" # Should have node14 installed in cli service lando node -v | tee >(cat 1>&2) | grep v18. diff --git a/examples/8.3/.lando.yml b/examples/8.3/.lando.yml index 59d162d..5e422bf 100644 --- a/examples/8.3/.lando.yml +++ b/examples/8.3/.lando.yml @@ -5,10 +5,8 @@ events: services: defaults: type: php:8.3 - composer_version: false cli: type: php:8.3 - composer_version: false via: cli build_as_root: - curl -sL https://deb.nodesource.com/setup_14.x | bash - diff --git a/examples/8.3/README.md b/examples/8.3/README.md index b8d4dee..ad0cbe1 100644 --- a/examples/8.3/README.md +++ b/examples/8.3/README.md @@ -74,9 +74,6 @@ lando exec custom -- php -m | grep "xdebug" # Should not serve port 80 for cli lando exec cli -- curl http://localhost || echo $? | grep 7 -# Should install the composer 2.x using the false flag -lando exec cli -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." - # Should use custom php ini if specified lando exec custom -- php -i | grep memory_limit | grep 514 lando exec custom -- curl http://custom_nginx | grep html_errors | grep On | grep On @@ -110,8 +107,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should install the latest composer 2.x by default. -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." +# Should not install composer when composer_version is false +lando exec cliworker -- composer --version --no-ansi 2>&1 | grep "executable file not found" # Should have node14 installed in cli service lando node -v | tee >(cat 1>&2) | grep v18. diff --git a/examples/8.4/.lando.yml b/examples/8.4/.lando.yml index ea1ba1e..da45168 100644 --- a/examples/8.4/.lando.yml +++ b/examples/8.4/.lando.yml @@ -5,7 +5,6 @@ events: services: defaults: type: php:8.4 - composer_version: false cli: type: php:8.4 composer_version: false @@ -16,7 +15,6 @@ services: - apt-get install -y nodejs cliworker: type: php:8.4 - composer_version: false via: cli command: sleep infinity custom: diff --git a/examples/8.4/README.md b/examples/8.4/README.md index 6f36748..dae24d0 100644 --- a/examples/8.4/README.md +++ b/examples/8.4/README.md @@ -71,9 +71,6 @@ lando exec custom_nginx -- curl https://localhost | grep "WEBDIR" # Should not serve port 80 for cli lando exec cli -- curl http://localhost || echo $? | grep 7 -# Should install the composer 2.x using the false flag -lando exec cli -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." - # Should use custom php ini if specified lando exec custom -- php -i | grep memory_limit | grep 514 lando exec custom -- curl http://custom_nginx | grep html_errors | grep On | grep On @@ -107,8 +104,8 @@ lando exec defaults -- curl http://localhost/path_info.php/a/b.php | grep SCRIPT # Should allow cli services to specify a boot up command lando info -s cliworker --deep | grep Cmd | grep sleep | grep infinity -# Should install the latest composer 2.x by default. -lando exec cliworker -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2." +# Should not install composer when composer_version is false +lando exec cliworker -- composer --version --no-ansi 2>&1 | grep "executable file not found" # Should have node 18 installed in cli service lando node -v | tee >(cat 1>&2) | grep v18. diff --git a/examples/composer/.lando.yml b/examples/composer/.lando.yml index 2b9f77f..86cf391 100644 --- a/examples/composer/.lando.yml +++ b/examples/composer/.lando.yml @@ -4,35 +4,38 @@ services: type: php:7.2 php83: type: php:8.3 + nocomposer: + type: php:8.3 + composer_version: false composer1: - type: php + type: php:7.4 composer_version: 1 composer2: - type: php + type: php:8.3 composer_version: 2 composer1latest: - type: php + type: php:8.3 composer_version: 1-latest composer2latest: - type: php + type: php:8.3 composer_version: 2-latest composer1ver: - type: php + type: php:8.3 composer_version: '1.10.21' composer2ver: - type: php + type: php:8.3 composer_version: '2.1.10' composer22: - type: php + type: php:8.3 composer_version: 2.2 composer22latest: type: php composer_version: 2.2-latest composer22ver: - type: php + type: php:8.3 composer_version: '2.2.10' dependencies: - type: php + type: php:8.3 composer_version: 2 composer: phpunit/phpunit: "*" diff --git a/examples/composer/README.md b/examples/composer/README.md index f7c8978..f4e60bb 100644 --- a/examples/composer/README.md +++ b/examples/composer/README.md @@ -28,6 +28,9 @@ lando exec php72 -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Co # PHP 8.3 Should install composer 2.8.x by default lando exec php83 -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 2.8." +# Should not install composer if composer_version is false +lando exec nocomposer -- composer --version --no-ansi 2>&1 | grep "executable file not found" + # Should install composer 1.x if composer_version set to 1 lando exec composer1 -- composer --version --no-ansi | tee >(cat 1>&2) | grep -q "Composer version 1."