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

Deprecation message breaks JSON output #9034

Closed
weirdan opened this issue Dec 31, 2022 · 9 comments · Fixed by #9162
Closed

Deprecation message breaks JSON output #9034

weirdan opened this issue Dec 31, 2022 · 9 comments · Fixed by #9162

Comments

@weirdan
Copy link
Collaborator

weirdan commented Dec 31, 2022

https://github.com/psalm/codeception-psalm-module/actions/runs/3810538569/jobs/6482681536#step:10:283

Failed to parse output: Warning: "findUnusedCode" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.

This has the potential to break tests for most of the plugins. The Codeception module used for testing redirects STDERR to STDOUT, so the JSON it then tries to read won't be valid.

/cc: @jack-worman

@vimeo vimeo deleted a comment from psalm-github-bot bot Dec 31, 2022
@weirdan
Copy link
Collaborator Author

weirdan commented Dec 31, 2022

@orklah please hold off doing the new release for now, until this is resolved one way or another.

@jack-worman
Copy link
Contributor

I am looking into it.

jack-worman added a commit to jack-worman/psalm that referenced this issue Dec 31, 2022
@jack-worman jack-worman mentioned this issue Dec 31, 2022
jack-worman added a commit to jack-worman/psalm that referenced this issue Dec 31, 2022
@danog
Copy link
Collaborator

danog commented Dec 31, 2022

@jack-worman please wait, the PR you submitted is not the right solution

@weirdan Currently the warning is output to STDERR, which is where we also output other non-json output like the progress bar, this is a misconfiguration of codeception, it really shouldn't parse JSON from STDERR too

jack-worman added a commit to jack-worman/psalm that referenced this issue Dec 31, 2022
@weirdan
Copy link
Collaborator Author

weirdan commented Dec 31, 2022

Currently the warning is output to STDERR, which is where we also output other non-json output like the progress bar,

Correct. But that is either out of the happy path or suppressed with --no-progress.

it really shouldn't parse JSON from STDERR too

Well, it's either that or STDERR is completely lost (Codeception CLI module uses exec()). And the latter makes debugging a nightmare. So Codeception Psalm module redirects STDERR to STDOUT.

@jack-worman
Copy link
Contributor

jack-worman commented Jan 18, 2023

What is the status of this? I would like to have a new release, what can I do to help?

@danog
Copy link
Collaborator

danog commented Jan 18, 2023

What's needed here is a change to the codeception psalm plugin to avoid parsing output from stderr, or otherwise ignore deprecation warnings outputted to stderr.

@alies-dev
Copy link
Contributor

@orklah please hold off doing the new release for now, until this is resolved one way or another.

How about hiding this findUnusedCode deprecation message for the upcoming release? Psalm doesn't have releases for almost a month. Once we found a solution for the issue, we can start displaying this message

PS: On my setup this Failed to parse output: Warning: "findUnusedCode" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting. message displayed twice (latest master branch)

@jack-worman
Copy link
Contributor

I created psalm/codeception-psalm-module#45 to hopefully solve the issue

@weirdan
Copy link
Collaborator Author

weirdan commented Jan 23, 2023

@orklah releases are no longer blocked.

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

Successfully merging a pull request may close this issue.

4 participants