<commit_before>Script Worker
===============================

[![Build Status](https://travis-ci.org/escapewindow/scriptworker.svg?branch=master)](https://travis-ci.org/escapewindow/scriptworker)

Script worker implements the [TaskCluster](http://docs.taskcluster.net/queue/worker-interaction/) worker model, then launches a pre-defined script.

This worker was designed for [Releng processes](https://bugzilla.mozilla.org/show_bug.cgi?id=1245837) that need specific, limited, and pre-defined capabilities.

Free software: MPL2 license

Usage
-----
* Create a config file.  By default scriptworker will look in `./secrets.json`, but this config path can be specified as the first and only commandline argument.  There is an [example config file](https://github.com/escapewindow/scriptworker/blob/master/config_example.json) and all config items are specified in [`scriptworker.config.DEFAULT_CONFIG`](https://github.com/escapewindow/scriptworker/blob/master/scriptworker/config.py#L13-L45).
* Launch: `scriptworker [config_path]`

Testing
-------
`python setup.py test`<commit_msg>integration test readme<commit_after>Script Worker
===============================

[![Build Status](https://travis-ci.org/escapewindow/scriptworker.svg?branch=master)](https://travis-ci.org/escapewindow/scriptworker)

Script worker implements the [TaskCluster](http://docs.taskcluster.net/queue/worker-interaction/) worker model, then launches a pre-defined script.

This worker was designed for [Releng processes](https://bugzilla.mozilla.org/show_bug.cgi?id=1245837) that need specific, limited, and pre-defined capabilities.

Free software: MPL2 license

Usage
-----
* Create a config file.  By default scriptworker will look in `./secrets.json`, but this config path can be specified as the first and only commandline argument.  There is an [example config file](https://github.com/escapewindow/scriptworker/blob/master/config_example.json) and all config items are specified in [`scriptworker.config.DEFAULT_CONFIG`](https://github.com/escapewindow/scriptworker/blob/master/scriptworker/config.py#L13-L45).
* Launch: `scriptworker [config_path]`

Testing
-------
Without integration tests,

`NO_TESTS_OVER_WIRE=1 python setup.py test`

With integration tests, first create a `./secrets.json` or `~/.scriptworker` that looks like

```json
{
    "taskcluster_client_id": "...",
    "taskcluster_access_token": "..."
}
```
then

`python setup.py test`
{'fraction_non_alphanumeric': 0.14825462012320328, 'fraction_numerical': 0.01026694045174538, 'mean_word_length': 5.327272727272727, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '274188', 'n_tokens_mistral': 732, 'n_tokens_neox': 686, 'n_words': 186}