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

Tests failing with default composer install #47

Closed
2 tasks done
justinmaurerdotdev opened this issue Aug 27, 2023 · 3 comments · Fixed by wp-cli/wp-cli-tests#176
Closed
2 tasks done

Tests failing with default composer install #47

justinmaurerdotdev opened this issue Aug 27, 2023 · 3 comments · Fixed by wp-cli/wp-cli-tests#176
Labels
bug Something isn't working scope:testing

Comments

@justinmaurerdotdev
Copy link

justinmaurerdotdev commented Aug 27, 2023

Bug Report

Describe the current, buggy behavior
Some syntax issues in my commits haven't been caught because I haven't been able to run the full test suite. This is because of a PHPCS error I've been getting in my environment. @danielbachhuber saw it on contributor day, but wasn't sure how to fix. The message is below, and appears any time I try to run composer test.

> run-linter-tests
PHP 8.2.9 | 10 parallel jobs
..                                                           2/2 (100 %)


Checked 2 files in 0 seconds
No syntax error found
> run-phpcs-tests
EE 2 / 2 (100%)



FILE: media-command.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | An error occurred during processing; checking has been aborted. The error message was: trim(): Passing null to parameter #1 ($string) of type string is deprecated in
   |       | /Users/justinmaurer/dev/wp-cli-dev/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php on line 194
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: src/Media_Command.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | An error occurred during processing; checking has been aborted. The error message was: trim(): Passing null to parameter #1 ($string) of type string is deprecated in
   |       | /Users/justinmaurer/dev/wp-cli-dev/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/WP/I18nSniff.php on line 194
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 111ms; Memory: 12MB

Script run-phpcs-tests handling the phpcs event returned with error code 1
Script @phpcs was called via test

It's happening with PHP 8.1 and 8.2. For some reason this doesn't seem to be happening in the automated commit tests (at least in the media-command repo), and is happening even with a fresh composer install in the wp-cli-dev repo, on the main branch. So I guess it might be something with my particular environment. Any suggestions?

@danielbachhuber
Copy link
Member

I'm experiencing the same issue. I'm not sure what it is, though. Upgrading might fix it wp-cli/wp-cli-tests#175

@danielbachhuber danielbachhuber added bug Something isn't working scope:testing labels Aug 28, 2023
@swissspidy
Copy link
Member

Yeah that's one of the PHP 8 compat issues that got resolved in WPCS 3.0. We should definitely get that upgrade sorted.

@danielbachhuber
Copy link
Member

Started with wp-cli/wp-cli-tests#176.

I think we'll need to tag a wp-cli-tests 4.0.0 release, and then update each repository individually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scope:testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants