Coder Social home page Coder Social logo

infection / tests-checker Goto Github PK

View Code? Open in Web Editor NEW
38.0 4.0 7.0 1.35 MB

[BOT] Requires writing the tests in Pull Requests.

Home Page: https://probot.github.io/apps/tests-checker/

License: ISC License

JavaScript 4.19% TypeScript 95.81%
probot-app github-app probot tests infection

tests-checker's Introduction

Warning

This GitHub App has been deprecated in favor of GitHub Action with the same functionality: https://github.com/infection/tests-checker-action

Build Status

Tests Checker

To install this bot to your Open Sourced project:

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:

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 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.
  • testPattern - a shell glob pattern that should match test files. For example, you can set it to testPattern: *_test.go and Bot will be able to understand, that added test has this pattern instead of located in testDir. testDir and testPattern are 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-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.

A GitHub App built with Probot that require writing tests in Pull Requests.

Developing

  1. Read https://probot.github.io/docs/development/#manually-configuring-a-github-app and configure smee
  2. add generated smee URL to .env - WEBHOOK_PROXY_URL variable, and to github app: https://github.com/settings/apps/tests-checker-dev
  3. Open terminal 1 and run smee -u https://smee.io/xxx
  4. open terminal 2 and run npm start
  5. now bot is ready to work from the local machine!

License

ISC © 2018 Maks Rafalko [email protected] (https://github.com/infection/tests-checker)

tests-checker's People

Contributors

dependabot[bot] avatar maks-rafalko avatar mmlb avatar mrafalkoitr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tests-checker's Issues

Only check `src` directory for changes

It would be great if we could limit the scope in which it looks for files. So rather than looking at all files that end in .php for example, it would only look for src/**/*.php. This way configuration changes in /phinx.php, config/parameters.php, etc. type of files would not trigger the suggestion.

testPattern

This looks pretty great and I'd love to make use of this bot but it doesn't fix the test setup in Go. Go (and some other langs) don't segregate tests into separate dirs. Instead, the test files match a pattern (in go *_test.go).

Would you be open to adding this in? testDir can be implented in this form too I think. If so, I'll be happy to try and get a PR up, after I learn enough TS to write it ;).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.