CONTRIBUTING.md in cpl-1.4.0 vs CONTRIBUTING.md in cpl-2.2.0

- old
+ new

@@ -4,29 +4,59 @@ Rather than installing `cpl` as a Ruby gem, install this repo locally and alias the `cpl` command globally for easier access, e.g.: ```sh -git clone https://github.com/shakacode/heroku-to-control-plane +git clone https://github.com/shakacode/control-plane-flow # Create an alias in some local shell startup script, e.g., `.profile`, `.bashrc`, etc. -alias cpl="~/projects/heroku-to-control-plane/bin/cpl" +alias cpl="~/projects/control-plane-flow/bin/cpl" ``` -## Linting/Testing +## Linting Before committing or pushing code, be sure to: - Run `bundle exec rake update_command_docs` to sync any doc changes made in the source code to the docs - Run `bundle exec rubocop -a` to fix any linting errors -- Run `bundle exec rspec` to run the test suite You can also install [overcommit](https://github.com/sds/overcommit) and let it automatically check for you: ```sh gem install overcommit overcommit --install +``` + +## Testing + +We use real apps for the tests. You'll need to have full access to a Control Plane org, and then set it as the env var `CPLN_ORG` when running the tests (or in the `.env` file): + +```sh +CPLN_ORG=your-org-for-tests bundle exec rspec +``` + +Alternatively, you might have a `.envrc` file with: + +```sh +export CPLN_ORG=shakacode-heroku-to-control-plane-ci +export RSPEC_RETRY_RETRY_COUNT=1 +``` + +Tests are separated between fast and slow. Slow tests can take a long time and usually involve building / deploying images and waiting for workloads to be ready / not ready, so they should only be run once in a while. + +If you add a slow test, tag it with `slow`. Tests without a `slow` tag are considered fast by default. + +To run fast tests: + +```sh +CPLN_ORG=your-org-for-tests bundle exec rspec --tag ~slow +``` + +To run slow tests: + +```sh +CPLN_ORG=your-org-for-tests bundle exec rspec --tag slow ``` ## Debugging 1. Use the `--verbose` option to see more detailed logs.