Giter Club home page Giter Club logo

testomatic's Introduction

testomatic logo

testomatic is a simple CLI tool which:

  1. Watch test files thanks to a configurable regular expression which match the filenames
  2. Execute a command of your choice when a file watched is saved (go test for example)
  3. Display a desktop notification indicating if your command succeeded or failed (see screenshots)
  4. You can continue coding without switching windows / terminal to see if your test passed!

Menu

Installation Configuration file Examples Contributing Disclaimer

Installation

You can find the releases of testomatic here: Github releases

Here an easy way to install testomatic on Linux using your favorite shell:

cd /usr/local/bin && sudo curl -LO https://github.com/Phantas0s/testomatic/releases/download/v0.2.2/testomatic && sudo chmod 755 testomatic && cd -

You can now normally run testomatic from anywhere.

Configuration file

testomatic need a valid yaml configuration file. The best is to create a .testomatic file at the root of your project.

You can as well use a different name for the configuration file: in that case you can run testomatic --config my-config-name.yml

The configuration file can change the behavior of testomatic drastically to adapt it to your needs. Here the details:

watch:
  root: src/Tests
  regex: "Test.php"
  ignore:
    - vendor
    - cache
  ignore_hidden: true
command:
  bin: docker-compose
  scope: current
  ignore_path: true
  abs: false
  options:
    - exec
    - "-T"
    - 'php'
    - bin/phpunit
notification:
  disable: false
  img_failure: /home/superUser/.autotest/images/failure.png
  img_success: /home/superUser/.autotest/images/success.png
  regex_success: ok
  regex_failure: fail
  display_result: true

watch

attribute value value type required default
root The root folder where your tests are. testomatic will watch into this folder and every subfolders recursively. string yes empty
regex Every filename matching this regex will be watched. string yes empty
ignore Files or folders you want to ignore (vendor for example) array no empty
ignore_hidden Any files or folders beginning by a point . won't be watched boolean no false

command

attribute value value type required default
bin Path of the command line interface to execute string yes empty
scope The command use the path of the saved file(current), the directory of the saved file (dir) or simply the root folder defined in watch (all) as argument string - current, dir, all yes empty
abs Use the saved file absolute path instead of the relative one boolean no false
ignore_path Doesn't use the path of the file saved as command line option boolean yes false
options Options to pass to the command line interface array no empty

notification

attribute value value type required default
disable Disable the desktop notifications boolean no false
img_failure Path of image displayed when test is failing string no empty
img_success Path of the image displayed when test is a success string no empty
regex_success If the result of the command match this regex, the test is a success string yes empty
regex_failure If the result of the command match this regex, the test is a failure string yes empty
display_result Display the return of the command in the notification box boolean no false

Examples

You will find in the folder examples tested configuration files for running PHPUnit and go test. I included in the php examples how to run tests in docker using docker-compose with or without notifications.

Screenshots

The notification is displayed with a text and image of your choice when saving the test testomatic example success

Too many go here testomatic example failure

The result of the test is displayed in a terminal testomatic example terminal result

Contributing

Pull request is the way ;)

Disclaimer

  • I only tested testomatic on Linux (Arch linux). It works on MacOS too (thanks @midnightrun).
  • You can use testomatic to run Golang and PHPUnit tests automatically. The configuration should be flexible enough for you to use it with other test frameworks / languages.

Licence

testomatic is under the MIT License

testomatic's People

Contributors

ewollesen avatar phantas0s avatar phux avatar sleeping-barber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.