Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaron Naveh committed Mar 9, 2013
1 parent a045cfa commit 34f5ce1
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Test-Creep - Node.js Selective Test Execution

Make testing 10x times faster by running only the tests affected by changed code. Seamlessly integrated with [Mocha](http://visionmedia.github.com/mocha/) (more frameworks coming soon).
Make testing 10x times faster by running only the tests affected by changed code. Seamlessly integrates with [Mocha](http://visionmedia.github.com/mocha/) (more frameworks coming soon).


## What is selective test execution?

Selective test execution means running just the relevant subset of your tests instead of all of them. For example, if you have 200 tests, and 10 of them are related to some feature, then if you make a change to this feature you should run only the 10 tests and not the whole 200. test-select automatically chooses the relevant tests based on [istanbul](https://github.com/gotwarlost/istanbul) code coverage reports. All this is done for you behind the scenes and you can work normally with just Mocha.
Selective test execution means running just the relevant subset of your tests instead of all of them. For example, if you have 200 tests, and 10 of them are related to some feature, then if you make a change to this feature you should run only the 10 tests and not the whole 200. test-creep automatically chooses the relevant tests based on [istanbul](https://github.com/gotwarlost/istanbul) code coverage reports. All this is done for you behind the scenes and you can work normally with just Mocha.

For more information visit [my blog](http://webservices20.blogspot.com/) or [my twitter](https://twitter.com/YaronNaveh).


## Installation and Usage
## Installation and usage

1. You should use [Mocha](http://visionmedia.github.com/mocha/) in your project to run tests. You should use git as a source control.

Expand All @@ -29,7 +29,7 @@ For more information visit [my blog](http://webservices20.blogspot.com/) or [my
`````
$> ./node_moduels/mocha/bin/mocha ./node_modules/test-creep/first.js ./tests
`````
first.js is bundled with test-select and monkey patchs mocha with the required instrumentation (via [istanbul](https://github.com/gotwarlost/istanbul)).
first.js is bundled with test-creep and monkey patchs mocha with the required instrumentation (via [istanbul](https://github.com/gotwarlost/istanbul)).

In addition, it is recommended to add .testdeps_.json to .gitignore (more on this file below).

Expand Down Expand Up @@ -60,14 +60,22 @@ Next time you run the tests (assuming you add first.js to the command) test-cree
At any moment you can run mocha without the 'first.js' parameter in which case all tests and not just relevant ones will run.


## Limitations
* Dependency between test and code is captured at file and not function granularity. So sometimes test-select can run more tests than actually requiered (though there is no harm in that).
## When to use test-creep
test-creep sweet spot is in long running test suites, where it can save many seconds and minutes each time you run tests. If you have a test suite that runs super fast (< 2 seconds) then test-creep will probably add more overhead than help. However when ever tests run more than that test-creep can save you time.


* test-select cannot detect changes in global contexts. For example, if you have a one time global initialization of a dictionary, and some tests use this dictionary, then test-select will not mark these tests as dirty if there is a change in the initialization code.
## Limitations
* Dependency between test and code is captured at file and not function granularity. So sometimes test-creep can run more tests than actually requiered (though there is no harm in that).

* If you have a test suite that runs super fast (< 2 seconds) then test-select will probably add more overhead than help. test-select sweet spot is in long running test suites, though it can be helpfull even if tests run just a few seconds too.
* test-creep cannot detect changes in global contexts. For example, if you have a one time global initialization of a dictionary, and some tests use this dictionary, then test-creep will not mark these tests as dirty if there is a change in the initialization code.

* Tests should have unique names even if they reside in different files/suites.


## Troubleshooting
At any moment you can run mocha without the 'first.js' parameter in which case mocha runs all tests as normal.
You can also delete .testdeps_.json if you wish test-creep to reinitialize its cache for any reason.


## More information
For more information visit [my blog](http://webservices20.blogspot.com/) or [my twitter](https://twitter.com/YaronNaveh).

0 comments on commit 34f5ce1

Please sign in to comment.