bluehost / endurance-page-cache

Other
24 stars 11 forks source link

Add new automated testing setup #90

Closed earnjam closed 4 years ago

earnjam commented 4 years ago

This PR does a few things:

1) Adds a @wordpress/env setup to the repo. This is a simple docker-based standardized local environment that can be used for testing or development. 1) Sets up additional scripts in package.json so testing all testing/linting commands can be run through npm run in addition to the wp-env setup. 1) Adds some GitHub Actions to automate running the phpunit tests and code linting on any pull requests or pushes to master. 1) Cleans up all coding standards violations in the file, since we'll be linting it against our Bluehost WP Coding Standards on PRs now.

earnjam commented 4 years ago

Looks great, but given the state of the checks on this PR, it looks like we need to make sure composer install is run.

haha, yep. Working on it 😄 . It wasn't an issue locally since I'd already run it manually.

earnjam commented 4 years ago

One downside of this vs other PHPUnit testing options is the Docker requirement. The upside of it is that the testing setup is identical when run locally to when it's run on GitHub.

It also seems like we're standardizing on Docker as the local development environment of choice for our projects (typically through Lando or @wordpress/env), so I think I'm ok with it.

earnjam commented 4 years ago

I changed wp-phpunit version requirement to * so that it always uses the latest version instead of being hardcoded to a specific version. That way it should always match what gets set in wp-env and we won't have to update it every release.