From a99204f1e2f2697890044fdaa809b7b54aac82b0 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Thu, 6 Jun 2019 18:52:16 -0400 Subject: [PATCH 1/4] Add a warning that a failure will be skipped. --- src/Command.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Command.php b/src/Command.php index 3839714..0f00995 100644 --- a/src/Command.php +++ b/src/Command.php @@ -305,6 +305,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $results_row[] = '✘ Failed (Ignoring)'; $params->state = 'success'; $params->description .= ' | TEST FAILED but is set to ignore.'; + $this->warningLite('Failure set to be ignored. Not triggering failure exit code or Commit Status.'); } else { $results_row[] = '✘ Failed'; $tests_failed = true; From 8acdc7c77fa58cb68842955bce845d86cbab9d66 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Thu, 6 Jun 2019 18:56:33 -0400 Subject: [PATCH 2/4] Alter the UI if the failure was ignored. --- src/Command.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Command.php b/src/Command.php index 0f00995..288b8ca 100644 --- a/src/Command.php +++ b/src/Command.php @@ -302,10 +302,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[] = '✘ Failed (Ignoring)'; + $results_row[] = '! Failed but ignoring'; $params->state = 'success'; - $params->description .= ' | TEST FAILED but is set to ignore.'; - $this->warningLite('Failure set to be ignored. Not triggering failure exit code or Commit Status.'); + $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[] = '✘ Failed'; $tests_failed = true; From 0045bedb13011597a7a490a4b51335533b0758c2 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Thu, 6 Jun 2019 19:00:00 -0400 Subject: [PATCH 3/4] Add the command line option 'groups'. --- src/Command.php | 6 ++++++ tests.yml | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Command.php b/src/Command.php index 288b8ca..504deef 100644 --- a/src/Command.php +++ b/src/Command.php @@ -114,6 +114,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.' + ); } /** diff --git a/tests.yml b/tests.yml index 76a9507..932654a 100644 --- a/tests.yml +++ b/tests.yml @@ -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 From fa0d6a2ad03b78aff942f06d818268616cb6dad4 Mon Sep 17 00:00:00 2001 From: Jon Pugh Date: Fri, 7 Jun 2019 14:03:24 -0400 Subject: [PATCH 4/4] Adding work in progress for Test and TestSuite classes. --- src/Test.php | 39 +++++++++++++++++++++++++++++++++++++++ src/TestSuite.php | 0 2 files changed, 39 insertions(+) create mode 100644 src/Test.php create mode 100644 src/TestSuite.php diff --git a/src/Test.php b/src/Test.php new file mode 100644 index 0000000..a02efd3 --- /dev/null +++ b/src/Test.php @@ -0,0 +1,39 @@ +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; + } + +} \ No newline at end of file diff --git a/src/TestSuite.php b/src/TestSuite.php new file mode 100644 index 0000000..e69de29