<commit_before>#!/usr/bin/env php
<?php
/**
 * Assumes to run in a SilverStripe webroot
 */
require_once 'lib.php';

$opts = getopt('', array(
	'if-env:',
	'base-url:',
));

// --if-env=BEHAT_TEST means that this script will only be executed if the given environment var is set
if(!checkenv(@$opts['if-env'])) {
	echo "Apache skipped; {$opts['if-env']} wasn't set.\n";
	exit(0);
}

$baseurl = (isset($opts['base-url'])) ? $opts['base-url'] : 'http://localhost:8000';

echo "Starting Sauce Connect...\n";

run("sh -e /etc/init.d/xvfb start");
if(!putenv("DISPLAY=:99.0")) echo "ERROR: Could not set display!\n";
run("wget http://selenium.googlecode.com/files/selenium-server-standalone-2.35.0.jar");
run("java -jar selenium-server-standalone-2.35.0.jar > /dev/null &");
sleep(5);

// Write templated behat configuration
$behatTemplate = file_get_contents(dirname(__FILE__).'/behat.tmpl.yml');<commit_msg>Store selenium log as artifact<commit_after>#!/usr/bin/env php
<?php
/**
 * Assumes to run in a SilverStripe webroot
 */
require_once 'lib.php';

$opts = getopt('', array(
	'if-env:',
	'base-url:',
));

// --if-env=BEHAT_TEST means that this script will only be executed if the given environment var is set
if(!checkenv(@$opts['if-env'])) {
	echo "Apache skipped; {$opts['if-env']} wasn't set.\n";
	exit(0);
}

$baseurl = (isset($opts['base-url'])) ? $opts['base-url'] : 'http://localhost:8000';

echo "Starting Sauce Connect...\n";

run("sh -e /etc/init.d/xvfb start");
if(!putenv("DISPLAY=:99.0")) echo "ERROR: Could not set display!\n";
run("wget http://selenium.googlecode.com/files/selenium-server-standalone-2.35.0.jar");
run("java -jar selenium-server-standalone-2.35.0.jar &> artifacts/selenium.log &");
sleep(5);

// Write templated behat configuration
$behatTemplate = file_get_contents(dirname(__FILE__).'/behat.tmpl.yml');
{'fraction_non_alphanumeric': 0.20740337506804574, 'fraction_numerical': 0.018508437670114317, 'mean_word_length': 4.725856697819315, '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': '4007531', 'n_tokens_mistral': 715, 'n_tokens_neox': 671, 'n_words': 149}