Skip to content

Commit

Permalink
Merge pull request #1 from wp-graphql/develop
Browse files Browse the repository at this point in the history
Update latest
  • Loading branch information
robbiebel authored Jan 12, 2025
2 parents 47910a4 + 36e79d3 commit 582d3b1
Show file tree
Hide file tree
Showing 75 changed files with 1,581 additions and 388 deletions.
35 changes: 33 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Contribute to WPGraphQL WooCommerce
## Contribute to WPGraphQL for WooCommerce

WPGraphQL WooCommerce (WooGraphQL) welcomes community contributions, bug reports and other constructive feedback.
WPGraphQL for WooCommerce (WooGraphQL) welcomes community contributions, bug reports and other constructive feedback.

When contributing please ensure you follow the guidelines below so that we can keep on top of things.

Expand All @@ -23,6 +23,37 @@ When contributing please ensure you follow the guidelines below so that we can k
* If possible, and if applicable, please also add/update unit tests for your changes
* Push the changes to your fork and submit a pull request to the 'develop' branch of this repository

### Setting up an environment to run the WPUnit tests

1. Create a `.env` file from the provided `.env.testing` and update the following section.

```env
# WordPress database configurations
DB_NAME=wordpress
DB_HOST=app_db
DB_PORT=3306
DB_USER=wordpress
DB_PASSWORD=password
ROOT_PASSWORD=password
WP_TABLE_PREFIX=wp_
SKIP_DB_CREATE=true
SKIP_WP_SETUP=true
```
The variable should be point to a local instance of MySQL and `SKIP_DB_CREATE` and `SKIP_WP_SETUP` should be set to `false`.
2. Run `composer installTestEnv` from the terminal in the plugin root directory. This will run the setup script and install all the required dependencies.
3. Run the tests by running `vendor/bin/codecept run wpunit` from the root directory. To learn about the libraries used to write the tests see [Codeception](https://codeception.com/), [WPBrowser](https://wpbrowser.wptestkit.dev/modules/WPBrowser/), and [WPGraphQL TestCase](https://github.com/wp-graphql/wp-graphql-testcase)
### Setting up a Docker environment to run the E2E tests
1. Run `composer installTestEnv` from the terminal in the plugin root directory to install all the required dependencies.
2. Next run `composer dRunApp`. This will build and start the docker network at http://localhost:8080 based off the configuration found in the `docker-compose.yml` in the project root.
3. Last run the test by running `composer dRunTest`. This runs the test suite by utilizing the `docker exec` command to run `vendor/bin/codecept run` from the project root within the docker container for wordpress site. You can pass further parameter to this comment by using the `FILTER` environment variable like so `FILTER="acceptance NewCustomerCheckingOutCept --debug" composer dRunTest`.
> **NOTE:** If you have no interest in the generated docker environment outside of automated test you can simply the process by just running the `dRunTestStandalone` command after the `installTestEnv` command combining steps 2 & 3, `composer dRunTestStandalone`. The command also reads the `FILTER` variables as well to so filter is possible `FILTER="acceptance NewCustomerCheckingOutCept --debug" composer dRunTestStandalone`.
## Code Documentation
* We strive for full doc coverage and follow the standards set by phpDoc
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.0', '7.4']
wordpress: ['6.3', '6.2', '6.1', '6.0']
php: ['8.3', '8.2', '8.1', '7.4']
wordpress: ['6.7', '6.3', '6.1']
composer_version: ['v2']
include:
- php: '7.4'
wordpress: '6.2'
- php: '8.3'
wordpress: '6.7'
coverage: '--coverage --coverage-xml'
xdebug: 1
- php: '8.1'
wordpress: '6.1'
debug: '--debug'
- wordpress: '6.2'
- wordpress: '6.3'
hpos: 1

fail-fast: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1
extensions: mbstring, intl
tools: composer
tools: composer:v2

- name: Get Composer Cache Directory
id: composer-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package-for-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
mkdir plugin-build
composer archive -vvv --format=zip --file="plugin-build/wp-graphql-woocommerce"
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: wp-graphql-woocommerce
path: plugin-build/wp-graphql-woocommerce.zip
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [v0.21.1](https://github.com/wp-graphql/wp-graphql-woocommerce/tree/v0.21.1) (2024-11-12)

[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/v0.21.0...v0.21.1)

**Fixed:**

- fix: Products query "where.search" param patched [\#903](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/903) ([kidunot89](https://github.com/kidunot89))
- fix: ID resolution made consistent across all edit and delete node mu… [\#902](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/902) ([kidunot89](https://github.com/kidunot89))
- fix: "Product" interfaces shared fields fix [\#901](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/901) ([kidunot89](https://github.com/kidunot89))
- chore: General "createOrder" cleanup [\#899](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/899) ([kidunot89](https://github.com/kidunot89))
- Fix: Correct number formatting by removing unnecessary price separators [\#888](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/888) ([ZZiane](https://github.com/ZZiane))

**Other Changes:**

- devops: composer-git-hooks added. CONTRIBUTING.md updated. [\#904](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/904) ([kidunot89](https://github.com/kidunot89))
- devops: Name officially changed to "WPGraphQL for WooCommerce" [\#900](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/900) ([kidunot89](https://github.com/kidunot89))
- chore: Minor documentation issues resolved [\#884](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/884) ([kidunot89](https://github.com/kidunot89))

## [v0.21.0](https://github.com/wp-graphql/wp-graphql-woocommerce/tree/v0.21.0) (2024-08-07)

[Full Changelog](https://github.com/wp-graphql/wp-graphql-woocommerce/compare/v0.20.0...v0.21.0)
Expand Down
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
ARG PHP_VERSION
FROM wordpress:php${PHP_VERSION}-apache

ARG XDEBUG_VERSION=2.9.6

RUN apt-get update; \
apt-get install -y --no-install-recommends \
# WP-CLI dependencies.
Expand All @@ -13,14 +11,15 @@ RUN apt-get update; \
wget;

# Setup xdebug. The latest version supported by PHP 5.6 is 2.5.5.
RUN pecl install "xdebug-${XDEBUG_VERSION}"; \
RUN pecl install xdebug; \
docker-php-ext-enable xdebug; \
echo "xdebug.default_enable = 1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "xdebug.remote_autostart = 0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "xdebug.remote_connect_back = 0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "xdebug.remote_enable = 1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "xdebug.remote_port = 9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "xdebug.remote_log = /var/www/html/xdebug.log" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini;
echo "xdebug.remote_log = /var/www/html/xdebug.log" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; \
echo "xdebug.mode = coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini;

# Install PDO MySQL driver.
RUN docker-php-ext-install pdo_mysql
Expand Down
Loading

0 comments on commit 582d3b1

Please sign in to comment.