<commit_before>'use strict'; // eslint-disable-line

const assert = require('assert');
const async = require('async');
const zookeeper = require('node-zookeeper-client');

const jsutil = require('arsenal').jsutil;
const ProvisionDispatcher =
          require('../../lib/provisioning/ProvisionDispatcher');

const ZK_TEST_PATH = '/tests/prov-test';

describe('provision dispatcher based on zookeeper recipes',
function testDispatch() {
    const zkConf = { connectionString: `localhost:2181${ZK_TEST_PATH}` };
    const provisionList = ['0', '1', '2', '3', '4', '5', '6', '7'];
    let clients = [];

    this.timeout(10000);

    before(done => {
        const zkClient = zookeeper.createClient('localhost:2181');
        zkClient.connect();
        zkClient.on('connected', () => {
            zkClient.mkdirp(ZK_TEST_PATH, err => {
                assert.ifError(err);
                const prov = new ProvisionDispatcher(zkConf);
                prov.addProvisions(provisionList, done);
            });
        });
    });
    afterEach(done => {
        async.each(clients, (client, cb) => {
            if (client !== undefined) {
                client.unsubscribe(cb);
            } else {
                cb();
            }
        }, err => {
            assert.ifError(err);
            clients = [];
            done();<commit_msg>test: disable zookeeper provisioning tests<commit_after>'use strict'; // eslint-disable-line

const assert = require('assert');
const async = require('async');
const zookeeper = require('node-zookeeper-client');

const jsutil = require('arsenal').jsutil;
const ProvisionDispatcher =
          require('../../lib/provisioning/ProvisionDispatcher');

const ZK_TEST_PATH = '/tests/prov-test';

// FIXME: those tests should be fixed and re-enabled on CircleCI.

describe.skip('provision dispatcher based on zookeeper recipes',
function testDispatch() {
    const zkConf = { connectionString: `localhost:2181${ZK_TEST_PATH}` };
    const provisionList = ['0', '1', '2', '3', '4', '5', '6', '7'];
    let clients = [];

    this.timeout(10000);

    before(done => {
        const zkClient = zookeeper.createClient('localhost:2181');
        zkClient.connect();
        zkClient.on('connected', () => {
            zkClient.mkdirp(ZK_TEST_PATH, err => {
                assert.ifError(err);
                const prov = new ProvisionDispatcher(zkConf);
                prov.addProvisions(provisionList, done);
            });
        });
    });
    afterEach(done => {
        async.each(clients, (client, cb) => {
            if (client !== undefined) {
                client.unsubscribe(cb);
            } else {
                cb();
            }
        }, err => {
            assert.ifError(err);
            clients = [];
            done();
{'fraction_non_alphanumeric': 0.15310147006095376, 'fraction_numerical': 0.015059160989602008, 'mean_word_length': 2.31353919239905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '6950882', 'n_tokens_mistral': 837, 'n_tokens_neox': 793, 'n_words': 163}