<commit_before>Velocity
========

Test runner (and community) for Meteor apps.  Under heavy development.

<img src="https://codeship.com/projects/ed973200-b7a3-0132-ec13-7eb16f937591/status?branch=develop" />

### What is Velocity?
Head over to the [official homepage](http://velocity.meteor.com) 

Find out more by watching the [Intro to Velocity](http://youtu.be/kwFv1mXrLWE?t=40m51s) talk that
 Robert, Sam, and Mike did at the June 2014 Meteor Devshop!

Read more in the [free chapter on Velocity in The Meteor Testing Manual](http://www.meteortesting.com/chapter/velocity)

### Getting Started

The Velocity package itself is not something that you include, rather you use Velocity-compatible
framework. 

To see frameworks in action, have a look at the [velocity-examples](https://github.com/meteor-velocity/velocity-examples) repository.
 
### Troubleshooting

Sometimes things break and its useful to get more debugging info.  Most of the test frameworks 
support some kind of debugging environment variable flag.  You can usually see a lot more details
about what's happening if you run your app with this command:

```bash
$ DEBUG=1 JASMINE_DEBUG=1 VELOCITY_DEBUG=1 VELOCITY_DEBUG_MIRROR=1 meteor
```

### Reporting bugs

Please report bugs directly on the issues of the framework(s) you are using. Framework authors 
will then post issues to the core if they are core issues.

##Velocity Compatible Packages

### Frameworks

Below is a list of the currently available frameworks.

Most of these frameworks have an example in the [velocity-examples](https://github.com/meteor-velocity/velocity-examples) repository, and have a set of sample tests that can be added to your project.

* [sanjo:jasmine](https://github.com/Sanjo/meteor-jasmine) - Write client and server unit and integration tests with Jasmine.
* [mike:mocha](https://github.com/mad-eye/meteor-mocha-web) - A Velocity version of mocha-web. Runs mocha tests in the Meteor context which is great for integration testing.
* [xolvio:cucumber](https://github.com/xolvio/meteor-cucumber) - Use Gherkin-syntax cucumber to 
test your app. Integrated nicely with [meteor-webdriver](https://github.com/xolvio/meteor-webdriver)  
* [clinical:nightwatch](https://github.com/awatson1978/clinical-nightwatch) - run acceptance tests with automated browsers using the Nightwatch bridge to Selenium
* [nblazer:casperjs](https://github.com/blazer82/meteor-casperjs/) - [CasperJS](http://casperjs.org) end to end test integration 
* [rsbatech:robotframework](https://github.com/rjsmith/meteor-robotframework) - [Robot Framework](http://robotframework.org/) end to end test integration using Selenium and many other [test libraries](http://robotframework.org/#test-libraries)

A lot more information on these frameworks can be found on the [Velocity website](http://velocity.meteor.com/) and in their respective repositories.

### Reporters

Reporters display test results.

* [velocity:html-reporter](https://github.com/meteor-velocity/html-reporter/) - Adds an overlay to your app indicating test success/failure (green/red dot in top right).  Click dot for test details.  `meteor add velocity:html-reporter`
* [velocity:console-reporter](https://github.com/meteor-velocity/console-reporter/) - Reports test run results to the console.  `meteor add velocity:console-reporter`

### Mirrors

Mirrors are used by test frameworks to run tests within. Tests are typically destructive and as such
require a different database. Mirrors run a parallel version of your app with a different 
database as not to intrude on the main development workflow.

### Other

* [xolvio:webdriver](https://github.com/xolvio/meteor-webdriver) - Adds webdriver.io to any test 
framework for UI testing. Uses PhantomJS in GhostDriver mode for ultra-fast UI testing

## Test Framework Authors

We would love to add your framework to the list!  Take a look at how some of these interface with velocity and let us know about your framework on the [velocity-core](https://groups.google.com/forum/#!forum/velocity-core) google group.

Please see the [velocity-wiki](https://github.com/meteor-velocity/velocity/wiki/How-to-integrate-a-test-framework-with-Velocity) for basic instructions on making your test framework work with Velocity.

Also, be sure to check out the [documentation for the public API](http://meteor-velocity.github.io/velocity/).
 
A few notes on being velocity-compatible:

### Register testing framework to Velocity

Use `Velocity.registerTestingFramework(frameworkName, options)` to register your package as testing framework. You can find a description of the expected arguments in the docs.


### Sample Tests

Please put some sample tests in a directory named `sample-tests` at the root of your package. 
These will be used by the velocity-quick-start package and also allows users to click a button 
in the html-reporter to have them added to their apps.

### Debug output

Please include a way to get more detailed info about your frameworks' test runs.  

One way that we've done it is by having an environment flag that the user can set.  Feel free to use `VELOCITY_DEBUG` if you'd like.  

For example, you could write your logging like this:

    var DEBUG = process.env.VELOCITY_DEBUG;
    DEBUG && console.log('[my-framework] helpful debugging info', someVar)

### Writing a new Mirror Package

See [instructions here](https://github.com/meteor-velocity/velocity/wiki/How-to-Write-a-Mirror-Package)

## For velocity:core maintainers

### Developing with a local version of velocity:core

1. Clone https://github.com/meteor-velocity/velocity-examples.git
2. Create a symlink to your local velocity:core package:

 ```bash
 cd velocity-examples/leaderboard-jasmine
 mkdir packages
 cd packages
 # Replace ~/velocity with your path 
 ln -s ~/velocity velocity:core
 ```

3. Start the velocity example app. It will use your local velocity:core version.

 ```bash
 cd ..
 meteor
 ```

### Publishing to Meteor Package System

1. Make code changes
2. Commit changes
3. Update History.md with summary of changes
4. Bump version numbers in package.js, History.md and yuidoc.json
5. Delete .build* folders and execute `yuidoc` command from velocity root path.
6. Commit changes
7. `meteor publish`
8. Tag last commit with the new version `X.X.X`
9. Push to github. Also push the new tag! (`git push --tags`)


We have to publish velocity:core for the different architectures (Mac OS, 64-bit Linux and 32-bit Linux). This is how it is done:

```bash
# Publish new version
meteor publish

# Open Mac build machine
meteor admin get-machine os.osx.x86_64
# Build on the machine
meteor publish-for-arch velocity:core@<VERSION>
# Login
# Exit
exit

# Open Linux build machine
meteor admin get-machine os.linux.x86_64
# Build on the machine (this will build a version for 64-bit and 32-bit Linux)
meteor publish-for-arch velocity:core@<VERSION>
# Login
# Exit
exit
```<commit_msg>include example of tagging velocity release<commit_after>Velocity
========

Test runner (and community) for Meteor apps.  Under heavy development.

<img src="https://codeship.com/projects/ed973200-b7a3-0132-ec13-7eb16f937591/status?branch=develop" />

### What is Velocity?
Head over to the [official homepage](http://velocity.meteor.com) 

Find out more by watching the [Intro to Velocity](http://youtu.be/kwFv1mXrLWE?t=40m51s) talk that
 Robert, Sam, and Mike did at the June 2014 Meteor Devshop!

Read more in the [free chapter on Velocity in The Meteor Testing Manual](http://www.meteortesting.com/chapter/velocity)

### Getting Started

The Velocity package itself is not something that you include, rather you use Velocity-compatible
framework. 

To see frameworks in action, have a look at the [velocity-examples](https://github.com/meteor-velocity/velocity-examples) repository.
 
### Troubleshooting

Sometimes things break and its useful to get more debugging info.  Most of the test frameworks 
support some kind of debugging environment variable flag.  You can usually see a lot more details
about what's happening if you run your app with this command:

```bash
$ DEBUG=1 JASMINE_DEBUG=1 VELOCITY_DEBUG=1 VELOCITY_DEBUG_MIRROR=1 meteor
```

### Reporting bugs

Please report bugs directly on the issues of the framework(s) you are using. Framework authors 
will then post issues to the core if they are core issues.

##Velocity Compatible Packages

### Frameworks

Below is a list of the currently available frameworks.

Most of these frameworks have an example in the [velocity-examples](https://github.com/meteor-velocity/velocity-examples) repository, and have a set of sample tests that can be added to your project.

* [sanjo:jasmine](https://github.com/Sanjo/meteor-jasmine) - Write client and server unit and integration tests with Jasmine.
* [mike:mocha](https://github.com/mad-eye/meteor-mocha-web) - A Velocity version of mocha-web. Runs mocha tests in the Meteor context which is great for integration testing.
* [xolvio:cucumber](https://github.com/xolvio/meteor-cucumber) - Use Gherkin-syntax cucumber to 
test your app. Integrated nicely with [meteor-webdriver](https://github.com/xolvio/meteor-webdriver)  
* [clinical:nightwatch](https://github.com/awatson1978/clinical-nightwatch) - run acceptance tests with automated browsers using the Nightwatch bridge to Selenium
* [nblazer:casperjs](https://github.com/blazer82/meteor-casperjs/) - [CasperJS](http://casperjs.org) end to end test integration 
* [rsbatech:robotframework](https://github.com/rjsmith/meteor-robotframework) - [Robot Framework](http://robotframework.org/) end to end test integration using Selenium and many other [test libraries](http://robotframework.org/#test-libraries)

A lot more information on these frameworks can be found on the [Velocity website](http://velocity.meteor.com/) and in their respective repositories.

### Reporters

Reporters display test results.

* [velocity:html-reporter](https://github.com/meteor-velocity/html-reporter/) - Adds an overlay to your app indicating test success/failure (green/red dot in top right).  Click dot for test details.  `meteor add velocity:html-reporter`
* [velocity:console-reporter](https://github.com/meteor-velocity/console-reporter/) - Reports test run results to the console.  `meteor add velocity:console-reporter`

### Mirrors

Mirrors are used by test frameworks to run tests within. Tests are typically destructive and as such
require a different database. Mirrors run a parallel version of your app with a different 
database as not to intrude on the main development workflow.

### Other

* [xolvio:webdriver](https://github.com/xolvio/meteor-webdriver) - Adds webdriver.io to any test 
framework for UI testing. Uses PhantomJS in GhostDriver mode for ultra-fast UI testing

## Test Framework Authors

We would love to add your framework to the list!  Take a look at how some of these interface with velocity and let us know about your framework on the [velocity-core](https://groups.google.com/forum/#!forum/velocity-core) google group.

Please see the [velocity-wiki](https://github.com/meteor-velocity/velocity/wiki/How-to-integrate-a-test-framework-with-Velocity) for basic instructions on making your test framework work with Velocity.

Also, be sure to check out the [documentation for the public API](http://meteor-velocity.github.io/velocity/).
 
A few notes on being velocity-compatible:

### Register testing framework to Velocity

Use `Velocity.registerTestingFramework(frameworkName, options)` to register your package as testing framework. You can find a description of the expected arguments in the docs.


### Sample Tests

Please put some sample tests in a directory named `sample-tests` at the root of your package. 
These will be used by the velocity-quick-start package and also allows users to click a button 
in the html-reporter to have them added to their apps.

### Debug output

Please include a way to get more detailed info about your frameworks' test runs.  

One way that we've done it is by having an environment flag that the user can set.  Feel free to use `VELOCITY_DEBUG` if you'd like.  

For example, you could write your logging like this:

    var DEBUG = process.env.VELOCITY_DEBUG;
    DEBUG && console.log('[my-framework] helpful debugging info', someVar)

### Writing a new Mirror Package

See [instructions here](https://github.com/meteor-velocity/velocity/wiki/How-to-Write-a-Mirror-Package)

## For velocity:core maintainers

### Developing with a local version of velocity:core

1. Clone https://github.com/meteor-velocity/velocity-examples.git
2. Create a symlink to your local velocity:core package:

 ```bash
 cd velocity-examples/leaderboard-jasmine
 mkdir packages
 cd packages
 # Replace ~/velocity with your path 
 ln -s ~/velocity velocity:core
 ```

3. Start the velocity example app. It will use your local velocity:core version.

 ```bash
 cd ..
 meteor
 ```

### Publishing to Meteor Package System

1. Make code changes
2. Commit changes
3. Update History.md with summary of changes
4. Bump version numbers in package.js, History.md and yuidoc.json
5. Delete .build* folders and execute `yuidoc` command from velocity root path.
6. Commit changes
7. `meteor publish`
8. Tag last commit with the new version (`git tag vX.X.X`)
9. Push to github. Also push the new tag! (`git push --tags`)


We have to publish velocity:core for the different architectures (Mac OS, 64-bit Linux and 32-bit Linux). This is how it is done:

```bash
# Publish new version
meteor publish

# Open Mac build machine
meteor admin get-machine os.osx.x86_64
# Build on the machine
meteor publish-for-arch velocity:core@<VERSION>
# Login
# Exit
exit

# Open Linux build machine
meteor admin get-machine os.linux.x86_64
# Build on the machine (this will build a version for 64-bit and 32-bit Linux)
meteor publish-for-arch velocity:core@<VERSION>
# Login
# Exit
exit
```
{'fraction_non_alphanumeric': 0.08943616331821128, 'fraction_numerical': 0.010081371066465039, 'mean_word_length': 4.5418994413407825, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 34, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4563907', 'n_tokens_mistral': 4253, 'n_tokens_neox': 3902, 'n_words': 1613}