-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2772 from CalderaWP/feature/2771
Refactor testing fixes #2771
- Loading branch information
Showing
2,262 changed files
with
771,709 additions
and
73,627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,12 @@ Requires: git, npm, Grunt. | |
- `git clone [email protected]:CalderaWP/Caldera-Forms.git` | ||
- Switch directory | ||
- `cd Caldera-Forms.git` | ||
- npm install | ||
- `npm i` | ||
- If you are using your own local development environment: | ||
- `npm i && composer install` | ||
- If you are wish to use the provided local development environment | ||
- `composer dev:install` | ||
|
||
|
||
### Build For Release | ||
To create a build to ship to WordPress.org: | ||
`npm run package` | ||
|
@@ -60,7 +64,11 @@ This is the old stuff, built with grunt. | |
### Test Environment | ||
All PHP tests are based off of the WordPress "unit" test suite, and therefore need a full WordPress test environment. The install script in '/bin' is pretty standard and should work with VVV or whatever. | ||
|
||
Alternatively, because this, isn't 2014, you can use the provided Docker environment. | ||
We provide a docker-based development environment. It is recommended that you use this environment because the setup is scripted and all of the tests can be run with it. | ||
|
||
The local server is [http://localhost:8228](http://localhost:8228) | ||
|
||
|
||
#### Requirements | ||
* Docker | ||
- [Installation documentation](https://docs.docker.com/install/) | ||
|
@@ -69,21 +77,52 @@ Alternatively, because this, isn't 2014, you can use the provided Docker environ | |
* npm | ||
- [Installation documentation](https://www.npmjs.com/get-npm) | ||
|
||
|
||
#### Install Test Environment | ||
* Install local development environment, dependencies and setup test forms | ||
- `composer dev:install` | ||
- May take awhile. | ||
* Go to [http://localhost:8228](http://localhost:8228) and make sure you have a WordPress site and can login. | ||
- Username: admin | ||
- password: password | ||
|
||
### Test Structures | ||
* PHP tests go in /tests and are run using phpunit | ||
* JavaScript tests go in clients/tests | ||
- Unit tests go in clients/tests/unit and are run using [Jest](https://facebook.github.io/jest/docs/en/getting-started.html) | ||
- Unit tests must have the word test in file name. For example, `formConfig.test.js` | ||
- Integration tests, which require WordPress, are in tests. These used to be all the tests we have. | ||
- Unit tests -- isolated tests that do NOT require WordPress -- go in `tests/Unit`. | ||
- The trait `calderawp\calderaforms\Util\Traits` should have all of the factories used for integration and unit tests (aspirational.) | ||
* JavaScript UNIT tests go in clients/tests | ||
- Unit tests go in clients/tests/unit and are run using [Jest](https://facebook.github.io/jest/docs/en/getting-started.html) | ||
- Unit tests must have the word test in file name. For example, `formConfig.test.js` | ||
* End to end tests go in `cypress/integration` amd are written using [Cypress](https://cypress.io) | ||
- See our [Cypress README for testing](./cypress/README.md) | ||
|
||
#### Commands | ||
* `composer wp-install` - Installs Docker-based test environment. | ||
* `composer wp-start` - Starts Docker-based test environment. | ||
* `composer wp-tests` - Runs phpunit inside of Docker container. | ||
* `composer wp-stop` - Stops Docker-based test environment, without destroying containers. | ||
* `composer wp-remove` - Stops Docker-based test environment and destroys containers. | ||
##### Composer | ||
* `composer dev:install` - Installs dependencies, Docker-based test environment and sets up test forms. | ||
* `composer dev:destroy` - Deletes dependencies and the Docker-based test environment. | ||
* `composer wp:install` - Installs Docker-based test environment. | ||
* `composer wp:start` - Starts Docker-based test environment. | ||
* `composer wp:activate` - Activate plugins in Docker-based environment. | ||
* `composer wp:tests` - Runs the PHP integration tests using phpunit inside Docker-based environment . | ||
* `composer wp:stop` - Stops Docker-based test environment, without destroying containers. | ||
* `composer wp:destroy` - Removes (including the database) the test environment and destroys containers. | ||
* `composer test:setup` - Adds test forms and puts them on pages. | ||
* `composer test:delete` - Delete test forms and pages the are on. | ||
* `composer nuke` - Deletes dependencies, including lock files -- NPM and Composer. | ||
|
||
##### Composer | ||
* `npm test` - Run JavaScript test watcher | ||
* `npm run test:once` - Run JavaScript unit tests once | ||
|
||
* `npm run test:e2e` - Start Cypress e2e test runner. | ||
* `npm run test:e2e:ci` - Trigger Cypress.io test record. | ||
|
||
##### wp-cli | ||
Probably don't use these directly. They will change. Must be prefaced with `docker-compose run --rm cli` | ||
* `wp cf import-test-forms` - Import test forms | ||
* `wp cf delete-test-forms` - Delete test forms | ||
* `wp cf create-test-pages` - Import test pages | ||
* `wp cf delete-test-pages` - Delete test pages | ||
### Release To WordPress.org | ||
##### Requires | ||
* [svn](https://subversion.apache.org/quick-start#installing-the-client) | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.