Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .scripts/build.sh → .scripts/create-plugin-zip.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Build ACTIONS-FILTERS.md
php create-actions-filters-docs.php

# Generate .pot file
php -n $(which wp) i18n make-pot ../ ../languages/convertkit.pot

# Remove vendor directory
cd ..
rm -rf vendor
Expand Down
19 changes: 9 additions & 10 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ An *approved* Pull Request is when a PR passes all tests **and** has been approv

In your Git client / command line, create a new branch called `release-x.x.x`, where `x.x.x` is the version number.

## Generate Localization File and Action/Filter Documentation

On your local machine, switch to the new release branch.

Run the `.scripts/build.sh` script, which will:

- Generate the `languages/convertkit.pot` file
- Generate the [ACTIONS-FILTERS.md](ACTIONS-FILTERS.md) file
- Produce a `convertkit.zip` Plugin file, which may be used for any manual testing on other environments

## Update the Plugin's Version Number

We follow [Semantic Versioning](https://semver.org/).
Expand All @@ -44,6 +34,15 @@ what took place in this version.

Each line in the changelog should start with `Added`, `Fix` or `Updated`.

## Generate Localization File and Action/Filter Documentation

On your local machine, switch to the new release branch.

Run `composer create-release-assets`, which will:

- Generate the `languages/convertkit.pot` file
- Generate the [ACTIONS-FILTERS.md](ACTIONS-FILTERS.md) file

## Commit Changes

Commit the updated files, which should comprise of:
Expand Down
29 changes: 28 additions & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ If you haven't yet set up your local development environment with the Kit Plugin

If you haven't yet created a branch and made any code changes to the Plugin, refer to the [Development Guide](DEVELOPMENT.md)

> **Familiar with wp-browser, Codeception, PHP Coding Standards and PHPStan?**
> Write your tests
> Run tests using `composer test [folder]/[cest]` or `composer test-integration [test]`
> Run PHP Coding Standards using `composer phpcs` and `composer phpcs-tests`
> Run static analysis using `composer phpstan`
> [Submit a Pull Request](https://github.com/ConvertKit/convertkit-wordpress/compare).

##

- Write your tests
- `composer test

## Write (or modify) a test

If your work creates new functionality, write a test.
Expand Down Expand Up @@ -377,6 +389,13 @@ To register your own helper function, add it to the `tests/Support/Helper/Wpunit

## Run Tests

> **Quick Commands**
> `composer test`: Run all End to End tests
> `composer test general`: Run all tests in the EndToEnd/general folder
> `composer test general/ActivateDeactivatePluginCest`: Run all tests in the EndToEnd/general/ActivateDeactivatePluginCest file
> `composer test-integration`: Run all Integration tests
> `composer test-integration APITest`: Run the Integration/APITest tests

Once you have written your code and test(s), run the tests to make sure there are no errors.

If ChromeDriver isn't running, open a new Terminal window and enter the following command:
Expand All @@ -392,13 +411,15 @@ vendor/bin/codecept build
vendor/bin/codecept run EndToEnd
vendor/bin/codecept run Integration
```

If a test fails, you can inspect the output and screenshot at `tests/_output`.

Any errors should be corrected by making applicable code or test changes.

## Run PHP CodeSniffer

> **Quick Command**
> `composer phpcs`: Run PHP Coding Standards on Plugin files

[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) checks that all Plugin code meets the
[WordPress Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/).

Expand Down Expand Up @@ -428,6 +449,9 @@ Need to change the PHP or WordPress coding standard rules applied? Either:

## Run PHPStan

> **Quick Command**
> `composer phpstan`: Run PHPStan static analysis on Plugin files

[PHPStan](https://phpstan.org) performs static analysis on the Plugin's PHP code. This ensures:

- DocBlocks declarations are valid and uniform
Expand All @@ -449,6 +473,9 @@ False positives [can be excluded by configuring](https://phpstan.org/user-guide/

## Run PHP CodeSniffer for Tests

> **Quick Command**
> `composer phpcs-tests`: Run PHP Coding Standards on test files

In the Plugin's directory, run the following command to run PHP_CodeSniffer, which will check the code meets Coding Standards
as defined in the `phpcs.tests.xml` configuration:

Expand Down
21 changes: 20 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "convertkit/convertkit-wordpress",
"description": "ConvertKit WordPress Plugin",
"description": "Kit WordPress Plugin",
"type": "project",
"license": "GPLv3",
"require": {
Expand All @@ -16,6 +16,25 @@
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"create-release-assets": [
"php -n $(which wp) i18n make-pot . languages/convertkit.pot",
"@php .scripts/create-actions-filters-docs.php"
],
"create-pot": "php -n $(which wp) i18n make-pot . languages/convertkit.pot",
"create-dev-docs": "@php .scripts/create-actions-filters-docs.php",
"phpcs": "vendor/bin/phpcs ./ -s -v",
"phpcs-tests": "vendor/bin/phpcs ./tests --standard=phpcs.tests.xml -s -v",
"phpstan": "vendor/bin/phpstan analyse --memory-limit=1250M",
"test": [
"vendor/bin/codecept build @no_additional_args",
"vendor/bin/codecept run EndToEnd @additional_args --fail-fast"
],
"test-integration": [
"vendor/bin/codecept build @no_additional_args",
"vendor/bin/codecept run Integration @additional_args --fail-fast"
]
},
"archive": {
"exclude": [
"!vendor/*",
Expand Down