Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ protected function configure()
'The hostname to use in the status description. Use if automatically detected hostname is not desired.',
gethostname()
);
$this->addOption(
'groups',
null,
InputOption::VALUE_OPTIONAL,
'Only run tests that are in the specified groups. Separate with a comma. Prefix with ! to exclude.'
);
$this->addArgument(
'filter',
InputArgument::IS_ARRAY,
Expand Down Expand Up @@ -378,9 +384,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
// If the test has the ignore failure flag, ignore it.
if (!empty($test['ignore-failure'])) {
$results_row[] = '<fg=red></> Failed (Ignoring)';
$results_row[] = '<fg=red>!</> Failed but ignoring';
$params->state = 'success';
$params->description .= ' | TEST FAILED but is set to ignore.';
$params->description .= ' | TEST FAILED but is configured to ignore failures.';
$this->warningLite('Test configured to ignore failures. Not triggering failure exit code or commit status.');
} else {
$results_row[] = '<fg=red>✘</> Failed';
$tests_failed = true;
Expand Down
39 changes: 39 additions & 0 deletions src/Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace ProvisionOps\YamlTests;

class Test {

/**
* @var mixed
*/
private $rawYml;

/**
* @var array
*/
private $commands = array();

function __construct($name, $raw_yml_object) {
$this->rawYml = $raw_yml_object;
}

private function parseYml() {
foreach ($this->rawYml as $name => $test_raw) {

// Simplest: command
if (is_string($test_raw)) {
$this->addCommand($test_raw);
}
}
}

/**
* Add to the
* @param $command
*/
private function addCommand($command) {
$commands[] = $command;
}

}
Empty file added src/TestSuite.php
Empty file.
11 changes: 9 additions & 2 deletions tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# tests/phpunit: phpunit
yaml-tests/lint: find src -name '*.php' -print0 | xargs -0 -n1 php -l
yaml-tests/phpcs: bin/phpcs --standard=PSR2 -n src --colors
yaml-tests/lint:
command: find src -name '*.php' -print0 | xargs -0 -n1 php -l
group: static

yaml-tests/phpcs:
command: bin/phpcs --standard=PSR2 -n src --colors
groups:
- static
- local

yaml-tess/ignore-failure:
command: thisisnotaworkingcommand
Expand Down