Is there a difference between Travis CI running my PHPUnit tests and me using the WP-CLI to generate unit test files and running phpunit locally? I’m wondering if the duplicate effort is necessary or unnecessary.

2 Answers
2

Travis is a hosted continuous integration service. Travis takes the files you’ve committed to your Github repo, and runs PHPUnit against them.

Notably different than running phpunit in your local environment is that running tests on Travis requires at least three steps:

  1. Commit to Git.
  2. Push to Github.
  3. Wait for Travis to create and run a build.

In the long term, it will be much faster for you to first run your tests locally before you commit, to reduce the amount of time you have to wait to see if your tests fail.

Leave a Reply

Your email address will not be published. Required fields are marked *