<commit_before><?php

namespace Lmc\Steward;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Process\ProcessBuilder;
use Symfony\Component\Process\Process;
use Nette\Utils\Finder;
use Nette\Reflection\AnnotationsParser;
use Nette\Utils\Strings;

/**
 * Run tests command is used to start Steward test planner and execute tests one by one,
 * optionaly with defined delay.
 *
 * @copyright LMC s.r.o.
 */
class RunTestsCommand extends Command
{
    /**
     * Array of objects with test processes, indexed by testcase fully qualified name
     *
     * @var array
     */
    protected $processes = [];

    /**
     * Configure command
     */
    protected function configure()
    {
        $this->setName('run-tests')
            ->setDescription('Run tests planner and execute tests')
            ->addArgument(
                'environment',
                InputArgument::REQUIRED,
                'Environment name (must be specified to avoid unintentional run against production)'
            )
            ->addArgument(
                'browser',
                InputArgument::OPTIONAL, // TODO: IS_ARRAY to allow multiple browsers?
                'Browsers in which tests should be run',
                'phantomjs'
            )
            ->addOption(
                'server-url',
                null,
                InputOption::VALUE_REQUIRED,
                'Selenium server (hub) hub hostname and port',
                'http://localhost:4444'
            )
            ->addOption(
                'dir',
                null,
                InputOption::VALUE_REQUIRED,
                'Path to directory with tests',
                realpath(__DIR__ . '/../tests')
            )
            ->addOption(<commit_msg>Make browser argument required to unexpected behavior when unintentionally ommiting environment name<commit_after><?php

namespace Lmc\Steward;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Process\ProcessBuilder;
use Symfony\Component\Process\Process;
use Nette\Utils\Finder;
use Nette\Reflection\AnnotationsParser;
use Nette\Utils\Strings;

/**
 * Run tests command is used to start Steward test planner and execute tests one by one,
 * optionaly with defined delay.
 *
 * @copyright LMC s.r.o.
 */
class RunTestsCommand extends Command
{
    /**
     * Array of objects with test processes, indexed by testcase fully qualified name
     *
     * @var array
     */
    protected $processes = [];

    /**
     * Configure command
     */
    protected function configure()
    {
        $this->setName('run-tests')
            ->setDescription('Run tests planner and execute tests')
            ->addArgument(
                'environment',
                InputArgument::REQUIRED,
                'Environment name (must be specified to avoid unintentional run against production)'
            )
            ->addArgument(
                'browser',
                InputArgument::REQUIRED,
                'Browser in which tests should be run'
            )
            ->addOption(
                'server-url',
                null,
                InputOption::VALUE_REQUIRED,
                'Selenium server (hub) hub hostname and port',
                'http://localhost:4444'
            )
            ->addOption(
                'dir',
                null,
                InputOption::VALUE_REQUIRED,
                'Path to directory with tests',
                realpath(__DIR__ . '/../tests')
            )
            ->addOption(
{'fraction_non_alphanumeric': 0.09182899064002024, 'fraction_numerical': 0.002023779408044523, 'mean_word_length': 1.9551569506726458, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '5684340', 'n_tokens_mistral': 1015, 'n_tokens_neox': 979, 'n_words': 269}