Repository navigation
fix(gatsby-source-wordpress): update test deps and fix int tests - #35582
Conversation
| install-plugin custom-post-type-ui WebDevStudios/custom-post-type-ui ${CPT_UI_VERSION} && \ | ||
|
|
||
| # WP GraphQL CPTUI from GitHub release | ||
| install-plugin wp-graphql-custom-post-type-ui wp-graphql/wp-graphql-custom-post-type-ui ${WPGRAPHQL_CPT_UI_VERSION} && \ |
There was a problem hiding this comment.
WPGraphQL has CPTUI support built in now
| # Set timezone | ||
| RUN echo 'date.timezone = "UTC"' > /usr/local/etc/php/conf.d/timezone.ini | ||
| # install system deps | ||
| RUN apt-get update && apt-get install unzip git -y && rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
broke these out because one was failing, this way the error message is more helpful
| "fields": null, | ||
| "name": "WpACF_GoogleMapFilterInput", | ||
| }, | ||
| Object { |
There was a problem hiding this comment.
The huge diff in this file is from updating all WP test site deps
| WPGATSBY_VERSION=v2.3.2 | ||
| WPGRAPHQL_ACF_VERSION=v0.5.3 | ||
| CPT_UI_VERSION=1.11.2 | ||
| ACF_VERSION=5.8.7 |
There was a problem hiding this comment.
I didn't update ACF because there's no oss mirror of the pro version with a version higher than this
| #!/bin/bash | ||
| set -e | ||
|
|
||
| echo "define( 'GRAPHQL_DEBUG', true );" >> /var/www/html/wp-config.php |
There was a problem hiding this comment.
Put WPGraphQL in debugging mode so there are more helpful errors when tests fail
| Settings: { | ||
| excludeFieldNames: [`generalSettingsEmail`], | ||
| }, | ||
| GeneralSettings: { | ||
| excludeFieldNames: [`email`], | ||
| }, | ||
| WPGatsby: { | ||
| exclude: true, | ||
| }, | ||
| PostTypeSEO: { | ||
| excludeFieldNames: [`twitterImage`], | ||
| }, | ||
| BlockAttributesObject: { | ||
| exclude: true, | ||
| }, | ||
| Post: { excludeFieldNames: [`pinged`] }, | ||
| } |
There was a problem hiding this comment.
On latest versions of plugins these fields cause GraphQL errors. This is normally fine because errors that return data are silenced in source-wordpress. I turned that off for tests (below) so we can see all errors. I also turned on the debugging option to panic on errors - this is so we can see very quickly when a gql error is happening and fail the test
There was a problem hiding this comment.
See the lines below 👇
| writeQueriesToDisk: true, | ||
| }, | ||
| }, | ||
| excludeFieldNames: [`commentCount`, `generalSettingsEmail`], |
There was a problem hiding this comment.
Same as the comment above ☝️
| twitterImage { | ||
| id | ||
| title | ||
| } |
There was a problem hiding this comment.
twitterImage seems to throw errors on latest WPGraphQL Yoast when you don't have an image set. Since we're panicking on errors I'm omitting this field
Seems WP int tests are broken again. This PR fixes them by upgrading WP deps to latest and updating the snapshots and excluded fields based on the upgraded deps