From f1af886ceca1924fbd4641d9d83d7ac66e597783 Mon Sep 17 00:00:00 2001 From: Konstantinos Kouratoras Date: Wed, 1 Nov 2017 13:18:08 +0200 Subject: [PATCH] add support for custom ignored annotations (fixes #32, via #35) --- README.md | 5 +++++ src/Yandex/Allure/Adapter/AllureAdapter.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 55298ba..8665541 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,9 @@ extensions: Yandex\Allure\Adapter\AllureAdapter: deletePreviousResults: false outputDirectory: allure-results + ignoredAnnotations: + - env + - dataprovider ``` `deletePreviousResults` will clear all `.xml` files from output directory (this @@ -37,6 +40,8 @@ relatively to Codeception output directory (also known as `paths: log` in codeception.yml) unless you specify an absolute path. You can traverse up using `..` as usual. `outputDirectory` defaults to `allure-results`. +`ignoredAnnotations` is used to define extra custom annotations to ignore. It is empty by default. + To generate report from your favourite terminal, [install](https://github.com/allure-framework/allure-cli#installation) allure-cli and run following command (assuming you're in project root and using diff --git a/src/Yandex/Allure/Adapter/AllureAdapter.php b/src/Yandex/Allure/Adapter/AllureAdapter.php index fe03ada..2467ecb 100644 --- a/src/Yandex/Allure/Adapter/AllureAdapter.php +++ b/src/Yandex/Allure/Adapter/AllureAdapter.php @@ -28,6 +28,7 @@ const OUTPUT_DIRECTORY_PARAMETER = 'outputDirectory'; const DELETE_PREVIOUS_RESULTS_PARAMETER = 'deletePreviousResults'; +const IGNORED_ANNOTATION_PARAMETER = 'ignoredAnnotations'; const DEFAULT_RESULTS_DIRECTORY = 'allure-results'; const DEFAULT_REPORT_DIRECTORY = 'allure-report'; const INITIALIZED_PARAMETER = '_initialized'; @@ -82,6 +83,7 @@ public function _initialize(array $ignoredAnnotations = []) // Add standard PHPUnit annotations Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations); // Add custom ignored annotations + $ignoredAnnotations = $this->tryGetOption(IGNORED_ANNOTATION_PARAMETER, []); Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations); $outputDirectory = $this->getOutputDirectory(); $deletePreviousResults =