Fix UploadTest webonyx/graphql-php version detection silently failing #471
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had clean clone & checkout test failure on
\Overblog\GraphQLBundle\Tests\Functional\Upload\UploadTest::testParseLiteralIsUnsupported
.There are a few problems I have detected:
VersionHelper::webonyxGraphQLPHPVersion
lookup for composer is prone. It useswhich composer
as fallback. But composer might also be available as an alias.Process
success is tested, but the command has multiple processes executed (pipe to grep) and so the return code of the last is tested against, which is grep. It caused a false positive, even thoughwhich composer
resolved to empty string and the execution failed withunknown command show
.Result:
When failing, you get no feedback what the actually issue is: fail to resolve the composer and/or version of webonyx/graphql-php..
So I wanted to fix this in a way which works with alias and gives proper feedback on failure, but realized it gets really messy. On top of this I also realized, that this actually tests vendor behavior, which a test should not do. So my PR is an opinionated proposal to not test explicit vendor behavior but for the possible outcome.