<commit_before>/* jshint node:true, mocha: true, expr:true*/

/**
 * @author kecso / https://github.com/kecso
 */

var testFixture = require('../../_globals.js');

describe('corediff-base', function () {
    'use strict';
    var gmeConfig = testFixture.getGmeConfig(),
        logger = testFixture.logger.fork('corediff-base'),
        storage,
        Q = testFixture.Q,
        expect = testFixture.expect;


    describe('commitAncestor', function () {
        describe('straight line', function () {
            var project,
                projectName = 'straightLineTest',
                projectId = testFixture.projectName2Id(projectName),
                gmeAuth,
                commitChain = [],
                chainLength = 1000; // FIXME: Do we really need 1000 commits?

            before(function (done) {
                testFixture.clearDBAndGetGMEAuth(gmeConfig, projectName)
                    .then(function (gmeAuth_) {
                        gmeAuth = gmeAuth_;
                        storage = testFixture.getMemoryStorage(logger, gmeConfig, gmeAuth);
                        return storage.openDatabase();
                    })
                    .then(function () {
                        return storage.deleteProject({projectId: projectId});
                    })
                    .then(function () {
                        return testFixture.importProject(storage, {
                            projectSeed: 'seeds/EmptyProject.json',
                            projectName: projectName,
                            gmeConfig: gmeConfig,
                            logger: logger
                        });
                    })
                    .then(function (importResult) {
                        //finally we create the commit chain
                        var needed = chainLength,
                            nextCommit = function (err, commitResult) {
                                if (err) {
                                    done(err);
                                    return;
                                }
                                needed -= 1;
                                commitChain.push(commitResult.hash);
                                if (needed === 0) {
                                    done();
                                } else {
                                    project.makeCommit(null,<commit_msg>Test: increase timeout for corediff.spec.js before hook.<commit_after>/* jshint node:true, mocha: true, expr:true*/

/**
 * @author kecso / https://github.com/kecso
 */

var testFixture = require('../../_globals.js');

describe('corediff-base', function () {
    'use strict';
    var gmeConfig = testFixture.getGmeConfig(),
        logger = testFixture.logger.fork('corediff-base'),
        storage,
        Q = testFixture.Q,
        expect = testFixture.expect;


    describe('commitAncestor', function () {
        describe('straight line', function () {
            var project,
                projectName = 'straightLineTest',
                projectId = testFixture.projectName2Id(projectName),
                gmeAuth,
                commitChain = [],
                chainLength = 1000; // FIXME: Do we really need 1000 commits?

            before(function (done) {
                this.timeout(4000); // creating 1000 commits on windows times out if tests are running with coverage.

                testFixture.clearDBAndGetGMEAuth(gmeConfig, projectName)
                    .then(function (gmeAuth_) {
                        gmeAuth = gmeAuth_;
                        storage = testFixture.getMemoryStorage(logger, gmeConfig, gmeAuth);
                        return storage.openDatabase();
                    })
                    .then(function () {
                        return storage.deleteProject({projectId: projectId});
                    })
                    .then(function () {
                        return testFixture.importProject(storage, {
                            projectSeed: 'seeds/EmptyProject.json',
                            projectName: projectName,
                            gmeConfig: gmeConfig,
                            logger: logger
                        });
                    })
                    .then(function (importResult) {
                        //finally we create the commit chain
                        var needed = chainLength,
                            nextCommit = function (err, commitResult) {
                                if (err) {
                                    done(err);
                                    return;
                                }
                                needed -= 1;
                                commitChain.push(commitResult.hash);
                                if (needed === 0) {
                                    done();
                                } else {
                                    project.makeCommit(null,
{'fraction_non_alphanumeric': 0.08927851672712615, 'fraction_numerical': 0.006045949214026602, 'mean_word_length': 1.0627597672485454, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6945597', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1088, 'n_words': 229}