Skip to content

Commit

Permalink
add support for custom ignored annotations (fixes #32, via #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
kouratoras authored and baev committed Nov 1, 2017
1 parent 1dbcef8 commit f1af886
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/Yandex/Allure/Adapter/AllureAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit f1af886

Please sign in to comment.