<commit_before>import os
from dye import tasklib
from dye.tasklib.django import _manage_py, _install_django_jenkins, create_private_settings, link_local_settings, clean_db, update_db, _manage_py_jenkins
from dye.tasklib.environment import env
from dye.tasklib.util import _rm_all_pyc, _check_call_wrapper

def build_webassets():
    print "### Build assets"
    _manage_py(['assets', 'clean'])
    _manage_py(['assets', 'build'])


def install_javascript_modules():
    print "### Installing javascript modules"
    javascript_dir = os.path.join(env['vcs_root_dir'], 'javascript')

    # If the directory already exists get rid of it and reinstall to keep
    # things clean.
    npm_dir = os.path.join(javascript_dir, 'node_modules')
    if os.path.exists(npm_dir):
        _check_call_wrapper(['rm', '-r', npm_dir])

    _check_call_wrapper(['npm', 'install'], cwd=javascript_dir)


def run_jenkins():
    """ make sure the local settings is correct and the database exists """
    env['verbose'] = True
    # don't want any stray pyc files causing trouble
    _rm_all_pyc()
    _install_django_jenkins()
    create_private_settings()
    link_local_settings('jenkins')
    clean_db()
    update_db()<commit_msg>Add task to run javascript tests<commit_after>import os
from dye import tasklib
from dye.tasklib.django import _manage_py, _install_django_jenkins, create_private_settings, link_local_settings, clean_db, update_db, _manage_py_jenkins
from dye.tasklib.environment import env
from dye.tasklib.util import _rm_all_pyc, _check_call_wrapper

def build_webassets():
    print "### Build assets"
    _manage_py(['assets', 'clean'])
    _manage_py(['assets', 'build'])


def install_javascript_modules():
    print "### Installing javascript modules"
    javascript_dir = os.path.join(env['vcs_root_dir'], 'javascript')

    # If the directory already exists get rid of it and reinstall to keep
    # things clean.
    npm_dir = os.path.join(javascript_dir, 'node_modules')
    if os.path.exists(npm_dir):
        _check_call_wrapper(['rm', '-r', npm_dir])

    _check_call_wrapper(['npm', 'install'], cwd=javascript_dir)


def run_javascript_tests():
    print "### Running Javascript tests"
    javascript_dir = os.path.join(env['vcs_root_dir'], 'javascript')

    _check_call_wrapper(['grunt', 'test'], cwd=javascript_dir)


def run_jenkins():
    """ make sure the local settings is correct and the database exists """
    env['verbose'] = True
    # don't want any stray pyc files causing trouble
    _rm_all_pyc()
    _install_django_jenkins()
    create_private_settings()
    link_local_settings('jenkins')
    clean_db()
    update_db()
{'fraction_non_alphanumeric': 0.10976989815164089, 'fraction_numerical': 0.0, 'mean_word_length': 4.752711496746204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5354568', 'n_tokens_mistral': 866, 'n_tokens_neox': 813, 'n_words': 212}