From 95f33310e9b45947862161eb6229984cbe12e4fe Mon Sep 17 00:00:00 2001 From: Maks Rafalko Date: Sun, 16 Sep 2018 16:19:29 +0300 Subject: [PATCH 1/4] Add tests-checker app --- _apps/tests-checker.md | 110 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 _apps/tests-checker.md diff --git a/_apps/tests-checker.md b/_apps/tests-checker.md new file mode 100644 index 0000000..68d664d --- /dev/null +++ b/_apps/tests-checker.md @@ -0,0 +1,110 @@ +--- +# A human-friendly name of your listing +title: Tests Checker +# A short description of what your app does +description: Requires writing the tests in Pull Requests. +# The slug of your hosted app on GitHub (https://github.com/apps/YOUR-SLUG) +slug: tests-checker +# Include a few screenshots that show your app in action +screenshots: +- https://user-images.githubusercontent.com/3725595/45590526-b7f3fa00-b942-11e8-972d-143c0b367017.png +# The GitHub usernames of anyone who authored the app +authors: [ borNfreee ] +# The repository where the code is located +repository: https://github.com/infection/tests-checker +# The address where this app is deployed +host: https://tests-checker.now.sh +--- + +# Tests Checker + +To install this bot to your Open Sourced project: + +* open https://github.com/apps/tests-checker +* click "Install" +* choose the repository you want to install `tests-checker` to + +tests-checker + + +## Settings + +You can configure bot by adding `.github/tests_checker.yml` file to the repository and override any of the settings listed below. + +Default values are: + +```yaml +comment: 'Could you please add tests to make sure this change works as expected?', +fileExtensions: ['.php', '.ts', '.js', '.c', '.cs', '.cpp', '.rb', '.java'] +testDir: 'tests' +``` + +where + +* `comment` - a text that bot will post when it won't find tests in the PR +* `fileExtensions` - extensions of the files that should be treated as a `source code`. Bot will do nothing if you just updating `README.md` because usually no tests are required to cover such change. +* `testDir` - folder, where tests are located. Make sure to set it correctly, otherwise bot will not be able to understand whether the test file was added or not. + +If you want to change only directory where the tests are placed, just add `.github/tests_checker.yml`: + +```yaml +testDir: app-tests +``` + +If you don't want to change anything, you can skip creating this file. + +## Setup + +This is needed if you want to deploy this bot to your server or want to contribute to it. Please note, that `tests-checker` is ready to use. You just need to install Github Application as mentioned in above. + +```sh +# Install dependencies +npm install + +# Run typescript +npm run build + +# Run the bot for production or +npm start + +# for development +npm run dev +``` + +## Deploy + +Install `now`: + +`npm install -g now` + +Deploy: + +```bash +now -e APP_ID=17064 \ + -e WEBHOOK_SECRET=XXX \ + -e PRIVATE_KEY_BASE64="$(cat ./key.pem | base64)" +``` + +Set a permanent alias for the new deployed application URL: + +```bash +now alias set https://tests-checker-XYZ.now.sh https://tests-checker.now.sh +``` + +### Debugging `now.sh` + +* `now ls tests-checker` +* `now inspect tests-checker.now.sh` +* `now rm tests-checker-qkkyxnelyo.now.sh` to free some instances available for OSS plan + +## Contributing + +If you have suggestions for how `tests-checker` could be improved, or want to report a bug, open an issue! We'd love all and any contributions. + +For more, check out the [Contributing Guide](CONTRIBUTING.md). + +> A GitHub App built with [Probot](https://github.com/probot/probot) that require writing tests in Pull Requests. + +## License + +[ISC](LICENSE) © 2018 Maks Rafalko (https://github.com/infection/tests-checker) From f932728871b134e3fc46e83e83a6ad0f454c6695 Mon Sep 17 00:00:00 2001 From: Maks Rafalko Date: Sun, 16 Sep 2018 16:50:04 +0300 Subject: [PATCH 2/4] Update tests-checker.md --- _apps/tests-checker.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/_apps/tests-checker.md b/_apps/tests-checker.md index 68d664d..8abbc5c 100644 --- a/_apps/tests-checker.md +++ b/_apps/tests-checker.md @@ -1,18 +1,11 @@ --- -# A human-friendly name of your listing title: Tests Checker -# A short description of what your app does description: Requires writing the tests in Pull Requests. -# The slug of your hosted app on GitHub (https://github.com/apps/YOUR-SLUG) slug: tests-checker -# Include a few screenshots that show your app in action screenshots: - https://user-images.githubusercontent.com/3725595/45590526-b7f3fa00-b942-11e8-972d-143c0b367017.png -# The GitHub usernames of anyone who authored the app authors: [ borNfreee ] -# The repository where the code is located repository: https://github.com/infection/tests-checker -# The address where this app is deployed host: https://tests-checker.now.sh --- From 0704f32477cda1dbb5b898bc8b2b0a08d6dae816 Mon Sep 17 00:00:00 2001 From: Maks Rafalko Date: Sun, 16 Sep 2018 16:56:15 +0300 Subject: [PATCH 3/4] Update tests-checker.md --- _apps/tests-checker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_apps/tests-checker.md b/_apps/tests-checker.md index 8abbc5c..e98dbce 100644 --- a/_apps/tests-checker.md +++ b/_apps/tests-checker.md @@ -5,7 +5,7 @@ slug: tests-checker screenshots: - https://user-images.githubusercontent.com/3725595/45590526-b7f3fa00-b942-11e8-972d-143c0b367017.png authors: [ borNfreee ] -repository: https://github.com/infection/tests-checker +repository: infection/tests-checker host: https://tests-checker.now.sh --- From b7ba870a3a79a4d591b2a61cdf3da92af9dbebd6 Mon Sep 17 00:00:00 2001 From: Maks Rafalko Date: Tue, 18 Sep 2018 21:43:35 +0300 Subject: [PATCH 4/4] Fix links --- _apps/tests-checker.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_apps/tests-checker.md b/_apps/tests-checker.md index e98dbce..8a6d125 100644 --- a/_apps/tests-checker.md +++ b/_apps/tests-checker.md @@ -94,10 +94,10 @@ now alias set https://tests-checker-XYZ.now.sh https://tests-checker.now.sh If you have suggestions for how `tests-checker` could be improved, or want to report a bug, open an issue! We'd love all and any contributions. -For more, check out the [Contributing Guide](CONTRIBUTING.md). +For more, check out the [Contributing Guide](https://github.com/infection/tests-checker/blob/master/CONTRIBUTING.md). > A GitHub App built with [Probot](https://github.com/probot/probot) that require writing tests in Pull Requests. ## License -[ISC](LICENSE) © 2018 Maks Rafalko (https://github.com/infection/tests-checker) +[ISC](https://github.com/infection/tests-checker/blob/master/LICENSE) © 2018 Maks Rafalko (https://github.com/infection/tests-checker)