Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi PHP + Multi Environment + Check all commits #212

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

javiercasares
Copy link
Contributor

@javiercasares javiercasares commented Mar 16, 2024

This is the Cloudfest Hackathon 2024 PR.

This PR solves:

  • Multi PHP. There is a new env option where you can set all the different PHP versions you want to test.
  • Multi Environment. You can set a label to differentiate, for example, your “shared”, “vps”, or “cloud” setups.
  • Check all commits. Until now, only the latest commit can be checked. With this new option, we can check the latest 10 commits so none of the commits are missing if they are approved without a lot of time between them.

The test-reporter will be upgraded to comply with these changes.

@javiercasares
Copy link
Contributor Author

- add the label
- test dir is a dir (a tmp one)
- no cert validation by default
- simple WP by default
- support for labels
- read latest commits
@javiercasares
Copy link
Contributor Author

The code is not very beauty, but it should work...

@javiercasares javiercasares marked this pull request as ready for review March 17, 2024 14:21
@javiercasares javiercasares changed the title Multi PHP Mar 17, 2024
this is a first step to include some documentation inside the project, and not only in the handbook page.
@@ -38,6 +42,9 @@ export WPT_TABLE_PREFIX=${WPT_TABLE_PREFIX-wptests_}
# (Optionally) define the PHP executable to be called
export WPT_PHP_EXECUTABLE=${WPT_PHP_EXECUTABLE-php}

# (Optionally) array of versions (like: 8.0+/bin/php8.0,8.1+/bin/php8.1)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# (Optionally) array of versions (like: 8.0+/bin/php8.0,8.1+/bin/php8.1)
# (Optionally) array of versions (like: 8.0=/bin/php8.0;8.1=/bin/php8.1)

Maybe we should use the Link header syntax instead 8.0=/bin/php8.0;8.1=/bin/php8.1 because the + is also used by semantic versioning and might be used in the executable string.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link
https://semver.org/#backusnaur-form-grammar-for-valid-semver-versions


## NodeJS installation

If you are using Debian / Ubuntu, install or update NodeJS 18 with this command:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If you are using Debian / Ubuntu, install or update NodeJS 18 with this command:
If you are using Debian / Ubuntu, install or update NodeJS 20 with this command:
# (Optionally) define the PHP executable to be called
export WPT_PHP_EXECUTABLE=${WPT_PHP_EXECUTABLE-php}

# (Optionally) array of versions (like: 8.0+/bin/php8.0,8.1+/bin/php8.1)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# (Optionally) array of versions (like: 8.0+/bin/php8.0,8.1+/bin/php8.1)
# (Optionally) array of versions (like: 8.0=/bin/php8.0;8.1=/bin/php8.1)

something like:

`8.0+/bin/php8.0,8.1+/bin/php8.1`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`8.0+/bin/php8.0,8.1+/bin/php8.1`
`8.0=/bin/php8.0;8.1=/bin/php8.1`
Use as much versions as you want, but it will take more time. The idea is to put all the versions offered to users.

```
export WPT_PHP_EXECUTABLE_MULTI=7.4+/bin/php7.4,8.3+/bin/php8.3
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export WPT_PHP_EXECUTABLE_MULTI=7.4+/bin/php7.4,8.3+/bin/php8.3
export WPT_PHP_EXECUTABLE_MULTI=7.4=/bin/php7.4;8.3=/bin/php8.3
@@ -65,9 +65,11 @@ function perform_operations( $operations ) {
foreach( $operations as $operation ) {
log_message( $operation );
passthru( $operation, $return_code );
/* THIS IS A TEMPORARY (or not) COMMENTED CODE
Copy link
Member

Choose a reason for hiding this comment

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

???


foreach( $php_multi_versions as $php_multi_version ) {

$php_multi_v = explode( '+', $php_multi_version );
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$php_multi_v = explode( '+', $php_multi_version );
$php_multi_v = explode( '=', $php_multi_version );
$WPT_PHP_EXECUTABLE_MULTI_ARRAY = array();
if ( '' !== $WPT_PHP_EXECUTABLE_MULTI ) {

$php_multi_versions = explode( ',', $WPT_PHP_EXECUTABLE_MULTI );
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$php_multi_versions = explode( ',', $WPT_PHP_EXECUTABLE_MULTI );
$php_multi_versions = explode( ';', $WPT_PHP_EXECUTABLE_MULTI );
@@ -27,6 +27,7 @@
$WPT_PREPARE_DIR = trim( getenv( 'WPT_PREPARE_DIR' ) );
$WPT_SSH_OPTIONS = trim( getenv( 'WPT_SSH_OPTIONS' ) );
$WPT_REPORT_API_KEY = trim( getenv( 'WPT_REPORT_API_KEY' ) );
$WPT_PHP_EXECUTABLE_MULTI = trim( getenv( 'WPT_PHP_EXECUTABLE_MULTI' ) ) ? : '';
Copy link
Member

Choose a reason for hiding this comment

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

maybe align it by the =

@@ -164,6 +276,7 @@
\$imagick_info = Imagick::queryFormats();
}
\$env = array(
'label' => '{$WPT_LABEL}',
Copy link
Member

Choose a reason for hiding this comment

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

there seems to be something broken with the indents?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants