Closed ivy00johns closed 6 years ago
If we add this line $ignoredAnnotations = $this->tryGetOption('ignoredAnnotations', []);
below the comment // Add custom ignored annotations
on line 83 of the AllureAdapter.php file everything starts working again.
/**
* Extra annotations to ignore in addition to standard PHPUnit annotations.
*
* @param array $ignoredAnnotations
*/
public function _initialize(array $ignoredAnnotations = [])
{
parent::_initialize();
Annotation\AnnotationProvider::registerAnnotationNamespaces();
// Add standard PHPUnit annotations
Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations);
// Add custom ignored annotations
$ignoredAnnotations = $this->tryGetOption('ignoredAnnotations', []);
Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations);
$outputDirectory = $this->getOutputDirectory();
$deletePreviousResults =
$this->tryGetOption(DELETE_PREVIOUS_RESULTS_PARAMETER, false);
$this->prepareOutputDirectory($outputDirectory, $deletePreviousResults);
if (is_null(Model\Provider::getOutputDirectory())) {
Model\Provider::setOutputDirectory($outputDirectory);
}
}
config:
Yandex\Allure\Adapter\AllureAdapter:
deletePreviousResults: false
outputDirectory: allure-results
ignoredAnnotations:
- env
- dataprovider
const IGNORED_ANNOTATION_PARAMETER = 'ignoredAnnotations';
$ignoredAnnotations = $this->tryGetOption(IGNORED_ANNOTATION_PARAMETER, []);
codecept_debug(">>>\n");
codecept_debug($ignoredAnnotations);
codecept_debug("<<<\n");
>>>
Array
(
)
<<<
does not work in my case
and dont see how it's going to work
private function tryGetOption($optionKey, $defaultValue = null)
{
if (array_key_exists($optionKey, $this->config)) {
return $this->config[$optionKey];
}
return $defaultValue;
}
Array
(
[_initialized] => 1
[config] => Array
(
[Yandex\Allure\Adapter\AllureAdapter] => Array
(
[deletePreviousResults] =>
[outputDirectory] => allure-results
[ignoredAnnotations] => Array
(
[0] => env
[1] => dataprovider
)
)
)
)
config structure should be something like : or tryGetOption is not going to get you anything.
config:
deletePreviousResults: false
outputDirectory: allure-results
ignoredAnnotations:
- env
- dataprovider
Array
(
[_initialized] => 1
[config] =>
[deletePreviousResults] =>
[outputDirectory] => allure-results
[ignoredAnnotations] => Array
(
[0] => env
[1] => dataprovider
)
)
$ignoredAnnotations = $this->tryGetOption(IGNORED_ANNOTATION_PARAMETER, []);
codecept_debug(">>>\n");
codecept_debug($ignoredAnnotations);
codecept_debug(">>>\n");
>>>
Array
(
[0] => env
[1] => dataprovider
)
>>>
Summon @kouratoras
@Stybbe123 just tested and works fine. Did you get the latest master
branch?
"allure-framework/allure-codeception": "~1.2.4" latest available release, plus your changes.
There is no release with that fix yet, only available to master
branch. You can test it by setting:
"allure-framework/allure-codeception": "dev-master"
tested again, works fine @ dev-master Is it going to be released soon ?
I'm submitting a ...
What is the current behavior?
When you have a Codeception test that includes a @env Test Annotation, like the following, and you run it you receive an Allure related error message:
Example Test
Stacktrace
What is the expected behavior?
I should be able to list a non-allure tag in the
codeception.yml
file and have Allure ignore those tags.Other Information
After the following commit, 5088ee4f7a6f76dfc4d664d4d2ac8ebd2697de01, was made our Codeception project no longer runs when the @env annotation is included in a Test.
After reverting some of the changes that were made to the _initialize function our Tests began running without the above error.