Skip to content

Commit f1af886

Browse files
kouratorasbaev
authored andcommitted
add support for custom ignored annotations (fixes #32, via #35)
1 parent 1dbcef8 commit f1af886

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ extensions:
2727
Yandex\Allure\Adapter\AllureAdapter:
2828
deletePreviousResults: false
2929
outputDirectory: allure-results
30+
ignoredAnnotations:
31+
- env
32+
- dataprovider
3033
```
3134
3235
`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
3740
codeception.yml) unless you specify an absolute path. You can traverse up using
3841
`..` as usual. `outputDirectory` defaults to `allure-results`.
3942

43+
`ignoredAnnotations` is used to define extra custom annotations to ignore. It is empty by default.
44+
4045
To generate report from your favourite terminal,
4146
[install](https://github.com/allure-framework/allure-cli#installation)
4247
allure-cli and run following command (assuming you're in project root and using

src/Yandex/Allure/Adapter/AllureAdapter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
const OUTPUT_DIRECTORY_PARAMETER = 'outputDirectory';
3030
const DELETE_PREVIOUS_RESULTS_PARAMETER = 'deletePreviousResults';
31+
const IGNORED_ANNOTATION_PARAMETER = 'ignoredAnnotations';
3132
const DEFAULT_RESULTS_DIRECTORY = 'allure-results';
3233
const DEFAULT_REPORT_DIRECTORY = 'allure-report';
3334
const INITIALIZED_PARAMETER = '_initialized';
@@ -82,6 +83,7 @@ public function _initialize(array $ignoredAnnotations = [])
8283
// Add standard PHPUnit annotations
8384
Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations);
8485
// Add custom ignored annotations
86+
$ignoredAnnotations = $this->tryGetOption(IGNORED_ANNOTATION_PARAMETER, []);
8587
Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations);
8688
$outputDirectory = $this->getOutputDirectory();
8789
$deletePreviousResults =

0 commit comments

Comments
 (0)