<commit_before>#!/usr/bin/env node
"use strict";

var platforms=["android", "ios", "win", "web"],
    config={}, now,
    tests_to_run=[];

var fs=require('fs-extra'),
	debug=require('debug')('RoambiTest:debug'),
	path=require('path'),
	argv=require('yargs')
		.help('help').alias('help', 'h')
		.option('config', {
			describe: 'config.json file to use saved settings',
			default:'./config.json'
		})
	    .option('platform', {
	    	alias:'p',
	        describe: 'platform name. One of <'+platforms.join("|")+'>'
	    })
	    .option('db.port', {
	    	describe: 'db port'
	    })
	    .option('db.host', {
	    	describe: 'db host'
	    })
		.config('config')
		.require('platform')
	    .check(verifyArgs)
	    .argv, i, j, subdirFiles,
    Mocha = require('mocha'),
    dateFormat = require('dateformat'),
    Model=require('./models/Model'),
    model=new Model("Mongo");

//validate the args passed are valid
function verifyArgs(argv, options) {
	//verify the platform is valid
	if( !argv.platform in platforms )
		return false;
	//verify the test is valid
	argv._.forEach(function(testFileToRun) {
		if( !fs.statSync(testFileToRun).isFile() )
			return false;
	});
	return true;
}

config.platform=argv.platform;
config.db={
	port: argv.db ? argv.db.port : undefined,
	host: argv.db ? argv.db.host : undefined
};
fs.writeFileSync(argv.config, JSON.stringify(config, null, 2));

debug("test arg "+argv._);
tests_to_run=argv._;

now=new Date();
process.env["multi"]="spec=- mocha-spec-json-reporter=/dev/null";
var mocha = new Mocha({
    ui: 'bdd',
    reporter: "mocha-multi"
});<commit_msg>made username and password optional<commit_after>#!/usr/bin/env node
"use strict";

var platforms=["android", "ios", "win", "web"],
    config={}, now,
    tests_to_run=[];

var fs=require('fs-extra'),
	debug=require('debug')('RoambiTest:debug'),
	path=require('path'),
	argv=require('yargs')
		.help('help').alias('help', 'h')
		.option('config', {
			describe: 'config.json file to use saved settings',
			default:'./config.json'
		})
	    .option('platform', {
	    	alias:'p',
	        describe: 'platform name. One of <'+platforms.join("|")+'>'
	    })
	    .option('db.port', {
	    	describe: 'db port'
	    })
	    .option('db.host', {
	    	describe: 'db host'
	    })
	    .option('db.login', {
	    	describe: 'db username'
	    })
	    .option('db.password', {
	    	describe: 'db password'
	    })
		.config('config')
		.require('platform')
	    .check(verifyArgs)
	    .argv, i, j, subdirFiles,
    Mocha = require('mocha'),
    dateFormat = require('dateformat'),
    Model=require('./models/Model'),
    model=new Model("Mongo");

//validate the args passed are valid
function verifyArgs(argv, options) {
	//verify the platform is valid
	if( !argv.platform in platforms )
		return false;
	//verify the test is valid
	argv._.forEach(function(testFileToRun) {
		if( !fs.statSync(testFileToRun).isFile() )
			return false;
	});
	return true;
}

config.platform=argv.platform;
config.db={
	port: argv.db ? argv.db.port : undefined,
	host: argv.db ? argv.db.host : undefined,
	user: argv.db ? argv.db.login : undefined,
	password: argv.db ? argv.db.password : undefined,
};
fs.writeFileSync(argv.config, JSON.stringify(config, null, 2));

debug("test arg "+argv._);
tests_to_run=argv._;

now=new Date();
process.env["multi"]="spec=- mocha-spec-json-reporter=/dev/null";
var mocha = new Mocha({
    ui: 'bdd',
    reporter: "mocha-multi"
});
{'fraction_non_alphanumeric': 0.1892205157925239, 'fraction_numerical': 0.0005795421616922632, 'mean_word_length': 3.596537949400799, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1096759', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1193, 'n_words': 260}