You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+33-2Lines changed: 33 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
## Contribute to WPGraphQL WooCommerce
1
+
## Contribute to WPGraphQL for WooCommerce
2
2
3
-
WPGraphQL WooCommerce (WooGraphQL) welcomes community contributions, bug reports and other constructive feedback.
3
+
WPGraphQL for WooCommerce (WooGraphQL) welcomes community contributions, bug reports and other constructive feedback.
4
4
5
5
When contributing please ensure you follow the guidelines below so that we can keep on top of things.
6
6
@@ -23,6 +23,37 @@ When contributing please ensure you follow the guidelines below so that we can k
23
23
* If possible, and if applicable, please also add/update unit tests for your changes
24
24
* Push the changes to your fork and submit a pull request to the 'develop' branch of this repository
25
25
26
+
### Setting up an environment to run the WPUnit tests
27
+
28
+
1. Create a `.env` file from the provided `.env.testing` and update the following section.
29
+
30
+
```env
31
+
# WordPress database configurations
32
+
DB_NAME=wordpress
33
+
DB_HOST=app_db
34
+
DB_PORT=3306
35
+
DB_USER=wordpress
36
+
DB_PASSWORD=password
37
+
ROOT_PASSWORD=password
38
+
WP_TABLE_PREFIX=wp_
39
+
SKIP_DB_CREATE=true
40
+
SKIP_WP_SETUP=true
41
+
42
+
```
43
+
44
+
The variable should be point to a local instance of MySQL and `SKIP_DB_CREATE` and `SKIP_WP_SETUP` should be set to `false`.
45
+
2. Run `composer installTestEnv` from the terminal in the plugin root directory. This will run the setup script and install all the required dependencies.
46
+
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)
47
+
48
+
### Setting up a Docker environment to run the E2E tests
49
+
50
+
1. Run `composer installTestEnv` from the terminal in the plugin root directory to install all the required dependencies.
51
+
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.
52
+
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`.
53
+
54
+
> **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`.
55
+
56
+
26
57
## Code Documentation
27
58
28
59
* We strive for full doc coverage and follow the standards set by phpDoc
- 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))
- devops: Name officially changed to "WPGraphQL for WooCommerce" [\#900](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/900) ([kidunot89](https://github.com/kidunot89))
19
+
- chore: Minor documentation issues resolved [\#884](https://github.com/wp-graphql/wp-graphql-woocommerce/pull/884) ([kidunot89](https://github.com/kidunot89))
0 commit comments