tests-checker
tests-checker copied to clipboard
[BOT] Requires writing the tests in Pull Requests.
Warning
This GitHub App has been deprecated in favor of GitHub Action with the same functionality: https://github.com/infection/tests-checker-action
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-checkerto
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:
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'
testPattern: ''
where
comment- a text that bot will post when it won't find tests in the PRfileExtensions- extensions of the files that should be treated as asource code. Bot will do nothing if you just updatingREADME.mdbecause 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.testPattern- a shell glob pattern that should match test files. For example, you can set it totestPattern: *_test.goand Bot will be able to understand, that added test has this pattern instead of located intestDir.testDirandtestPatternare alternatives, however can be used together.
Both testDir and testPattern may be specified in a custom configuration, both settings will be used to locate test files.
If you want to change any of the settings, just add .github/tests_checker.yml:
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.
# 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:
now -e APP_ID=17064 \
-e WEBHOOK_SECRET=XXX \
-e PRIVATE_KEY_BASE64="$(cat ./key.pem | base64)"
See WEBHOOK_SECRET on GitHub app: https://github.com/settings/apps/tests-checker.
Set a permanent alias for the new deployed application URL:
now alias set https://tests-checker-XYZ.now.sh https://tests-checker.now.sh
Debugging now.sh
now ls tests-checkernow inspect tests-checker.now.shnow rm tests-checker-qkkyxnelyo.now.shto 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.
A GitHub App built with Probot that require writing tests in Pull Requests.
Developing
- Read https://probot.github.io/docs/development/#manually-configuring-a-github-app and configure
smee - add generated
smeeURL to.env-WEBHOOK_PROXY_URLvariable, and to github app: https://github.com/settings/apps/tests-checker-dev - Open terminal 1 and run
smee -u https://smee.io/xxx - open terminal 2 and run
npm start - now bot is ready to work from the local machine!
License
ISC © 2018 Maks Rafalko [email protected] (https://github.com/infection/tests-checker)