diff options
| author | jvoisin | 2017-10-26 11:45:47 +0200 |
|---|---|---|
| committer | jvoisin | 2017-10-26 11:45:47 +0200 |
| commit | 5964129ff04d797081a0b24fb9683a909e1cc0e3 (patch) | |
| tree | 4aa9e5949ada8f93791cc1fbe7f3c7320dc873d3 /CONTRIBUTING.md | |
| parent | 0c333467618e214f6a48391a3743ead8d3a6f405 (diff) | |
Improve a bit our CONTRIBUTING.md file
Diffstat (limited to '')
| -rw-r--r-- | CONTRIBUTING.md | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 835317f..fecee0b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md | |||
| @@ -25,24 +25,22 @@ git checkout -b 325-kill-sql-injections | |||
| 25 | ### 3. Get the test suite running | 25 | ### 3. Get the test suite running |
| 26 | 26 | ||
| 27 | Just type `make coverage` or `make debug`, the testsuite should be run | 27 | Just type `make coverage` or `make debug`, the testsuite should be run |
| 28 | automatically. Please do add tests if you're fixing a bug or adding a new feature. | 28 | automatically. |
| 29 | 29 | ||
| 30 | #### Debugging failures in the test suite | 30 | Please add tests if you're fixing a bug or adding a new feature: we do have a |
| 31 | [high coverage](https://coveralls.io/github/nbs-system/snuffleupagus?branch=master) | ||
| 32 | (functions, lines and branches), and intend to keep it that way. | ||
| 33 | |||
| 34 | #### 3.3 Debugging failures in the test suite | ||
| 31 | 35 | ||
| 32 | If your changes have introduced run-time failures in the test-suite, you can | 36 | If your changes have introduced run-time failures in the test-suite, you can |
| 33 | easily attach your debugger to analyse that particular test case by doing the | 37 | easily troubleshoot them by inspecting the files that |
| 34 | following: | 38 | [php has generated](https://qa.php.net/write-test.php#analyzing-failing-tests) |
| 35 | ``` | 39 | for this purpose. |
| 36 | make debug | 40 | |
| 37 | cd src/ | 41 | A nice trick is to edit the `.sh` file to prepend `gdb --args` to it before |
| 38 | make test TESTS="-v --show-diff" | 42 | launching it, in order to run the failing test inside GDB. |
| 39 | ``` | ||
| 40 | Adding the `-v` flag will provide more information (e.g. the full command used | ||
| 41 | to run that particular test case), and `--show-diff` will (if the test case | ||
| 42 | failed) show the difference between what was returned, and what was expected. | ||
| 43 | 43 | ||
| 44 | If you'd like to see what other options are available for debugging test cases, | ||
| 45 | you can add `-h` to the `TESTS` variable. | ||
| 46 | 44 | ||
| 47 | ### 4. Did you find a bug? | 45 | ### 4. Did you find a bug? |
| 48 | 46 | ||
| @@ -66,7 +64,7 @@ before committing, or even better, use a [pre-commit hook](https://github.com/an | |||
| 66 | ### 6. Make a Pull Request | 64 | ### 6. Make a Pull Request |
| 67 | 65 | ||
| 68 | At this point, you should switch back to your master branch and make sure it's | 66 | At this point, you should switch back to your master branch and make sure it's |
| 69 | up to date with Active Admin's master branch: | 67 | up to date with our upstream master branch: |
| 70 | 68 | ||
| 71 | ```sh | 69 | ```sh |
| 72 | git remote add upstream git@github.com:nbs-system/snuffleupagus.git | 70 | git remote add upstream git@github.com:nbs-system/snuffleupagus.git |
| @@ -84,12 +82,12 @@ git push --set-upstream origin 325-kill-sql-injections | |||
| 84 | 82 | ||
| 85 | Finally, go to GitHub and [make a Pull Request](https://help.github.com/articles/creating-a-pull-request) :D | 83 | Finally, go to GitHub and [make a Pull Request](https://help.github.com/articles/creating-a-pull-request) :D |
| 86 | 84 | ||
| 87 | Travis CI will run our test suite against all supported PHP versions. We care | 85 | Travis CI will [run our test suite](https://travis-ci.org/nbs-system/snuffleupagus) |
| 88 | about quality, so your PR won't be merged until all tests pass. It's unlikely, | 86 | against all supported PHP versions. We care about quality, so your PR won't be |
| 89 | but it's possible that your changes pass tests in one PHP version but fail in | 87 | merged until all tests pass. It's unlikely, but it's possible that your changes |
| 90 | another. In that case, you'll have to setup your development environment | 88 | pass tests in one PHP version but fail in another. In that case, you'll have to |
| 91 | to use the problematic PHP version, and investigate | 89 | setup your development environment to use the problematic PHP version, and |
| 92 | what's going on! | 90 | investigate what's going on! |
| 93 | 91 | ||
| 94 | ### 7. Keeping your Pull Request updated | 92 | ### 7. Keeping your Pull Request updated |
| 95 | 93 | ||
| @@ -109,27 +107,28 @@ git push --force-with-lease 325-kill-sql-injections | |||
| 109 | 107 | ||
| 110 | A PR can only be merged into master by a maintainer if: | 108 | A PR can only be merged into master by a maintainer if: |
| 111 | 109 | ||
| 112 | * It is passing CI. | 110 | 1. It is passing CI. |
| 113 | * It has been approved by at least two maintainers. If it was a maintainer who | 111 | 2. It has been approved by at least one maintainer. If it was a maintainer who |
| 114 | opened the PR, only one extra approval is needed. | 112 | opened the PR, only one extra approval is needed. |
| 115 | * It has no requested changes. | 113 | 3. It has no requested changes. |
| 116 | * It is up to date with current master. | 114 | 4. It is up to date with current master. |
| 117 | 115 | ||
| 118 | Any maintainer is allowed to merge a PR if all of these conditions are | 116 | Any maintainer is allowed to merge a PR if all of these conditions are met. |
| 119 | met. | ||
| 120 | 117 | ||
| 121 | ### 9. Shipping a release (maintainers only) | 118 | ### 9. Shipping a release (maintainers only) |
| 122 | 119 | ||
| 123 | Maintainers need to do the following to push out a release: | 120 | Maintainers need to do the following to push out a release: |
| 124 | 121 | ||
| 125 | * Make sure all pull requests are in and that changelog is current | 122 | 1. Make sure all pull requests are in and that changelog is current |
| 126 | * Update `snuggleupagus.h` file and changelog with new version number | 123 | 2. Update `snuffleupagus.h` file and changelog with new version number |
| 127 | * Create a stable branch for that release: | 124 | 3. Create a tag for that release: |
| 128 | 125 | ||
| 129 | ```sh | 126 | ```sh |
| 130 | git pull master | 127 | git checkout master |
| 128 | git pull origin master | ||
| 131 | make coverage | 129 | make coverage |
| 132 | git tag -s $MAJOR.$MINOR.$PATCH | 130 | git tag -s $MAJOR.$MINOR.$PATCH |
| 133 | git push --tags | 131 | git push --tags |
| 134 | ``` | 132 | ``` |
| 135 | * Do the *secret release dance* \ No newline at end of file | 133 | |
| 134 | 4. Do the *secret release dance* | ||
