Skip to content

Add support for custom ignored annotations#35

Merged
baev merged 2 commits into
allure-framework:masterfrom
kouratoras:patch-1
Nov 1, 2017
Merged

Add support for custom ignored annotations#35
baev merged 2 commits into
allure-framework:masterfrom
kouratoras:patch-1

Conversation

@kouratoras

@kouratoras kouratoras commented Oct 3, 2017

Copy link
Copy Markdown
Contributor

Currently, custom ignored annotations are not added, hence an exception can be thrown (i.e. in case of dataprovider annotation). I suggest to add support for custom ignored annotations, as defined in configuration file.

Fixes #32

Currently, custom ignored annotations are not added, hence an exception can be thrown (i.e. in case of `dataprovider` annotation). I suggest to add support for custom ignored annotations, as defined in configuration file.
@CLAassistant

CLAassistant commented Oct 3, 2017

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@kouratoras

Copy link
Copy Markdown
Contributor Author

@baev this is tested and works as expected. Can you please take a look and merge if everything is OK? Thank you!

@baev

baev commented Oct 31, 2017

Copy link
Copy Markdown
Member

is there any way to make AllureAdaptor skip all unknown annotations? Other way it seems hacky

@kouratoras

Copy link
Copy Markdown
Contributor Author

@dataprovider is the one that causes me issues, should I add it in $ignoredAnnotations instead of supporting custom ignored annotations?

@baev

baev commented Oct 31, 2017

Copy link
Copy Markdown
Member

I mean why do we need to specify ignored annotations? If there is no way to process only allure annotations can we catch the exception and skip it?

@kouratoras

Copy link
Copy Markdown
Contributor Author

Docblock parser throws an exception in this case:

[Doctrine\Common\Annotations\AnnotationException]                                                                                                                                                                
  [Semantical Error] The annotation "@dataprovider" was never imported. Did you maybe forget to add a "use" statement for this annotation?

Anyway, Codeception adapter already includes a list of annotations that should be ignored by the parser (mostly coming from PHPUnit). If we could add dataprovider and env in that list, that would work for me as well.

@baev what do you think?

@baev

baev commented Nov 1, 2017

Copy link
Copy Markdown
Member

I am fine with the current patch, just asking is there any better solution (that will work for all the users without additional configuration). If not, I'll merge it

@kouratoras

Copy link
Copy Markdown
Contributor Author

I don't see a better solution in the adapter, as the exception is coming from Doctrine parser.

Even custom ignored annotations should be supported or the 2 annotations that I mentioned above should be added in $ignoredAnnotations. The second option should work for all users out of the box, in case they use them in their code.

@baev baev merged commit f1af886 into allure-framework:master Nov 1, 2017
@kouratoras kouratoras deleted the patch-1 branch November 1, 2017 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants