4

Our current project uses Codeception with the Codeception Allure addon and we are now seeing the following error when we run codecept run acceptance --env chrome --group banana --debug. This error began appearing a few days ago and we are unsure how to correct it. Has anyone ran into this error recently? I have found a number of old posts regarding similar issues but they have all been fixed by the project owners.

  [Doctrine\Common\Annotations\AnnotationException]                            
  [Semantical Error] The annotation "@env" in method 
  LogIntoAdminCest::logIntoAdmin() was never imported. Did you maybe 
  forget to add a "use" statement for this annotation?    


  Exception trace:
  () at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
  Doctrine\Common\Annotations\AnnotationException::semanticalError() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:727
  Doctrine\Common\Annotations\DocParser->Annotation() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:663
  Doctrine\Common\Annotations\DocParser->Annotations() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:354
  Doctrine\Common\Annotations\DocParser->parse() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php:284
  Doctrine\Common\Annotations\AnnotationReader->getMethodAnnotations() at /vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/IndexedReader.php:71
  Doctrine\Common\Annotations\IndexedReader->getMethodAnnotations() at /vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Annotation/AnnotationProvider.php:43
  Yandex\Allure\Adapter\Annotation\AnnotationProvider::getMethodAnnotations() at /vendor/allure-framework/allure-codeception/src/Yandex/Allure/Adapter/AllureAdapter.php:250
  Yandex\Allure\Adapter\AllureAdapter->testStart() at n/a:n/a
  call_user_func() at /vendor/symfony/event-dispatcher/EventDispatcher.php:212
  Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() at /vendor/symfony/event-dispatcher/EventDispatcher.php:44
  Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at /vendor/codeception/codeception/src/Codeception/PHPUnit/Listener.php:90
  Codeception\PHPUnit\Listener->startTest() at /vendor/phpunit/phpunit/src/Framework/TestResult.php:386
  PHPUnit_Framework_TestResult->startTest() at /vendor/codeception/codeception/src/Codeception/Test/Test.php:74
  Codeception\Test\Test->run() at /vendor/phpunit/phpunit/src/Framework/TestSuite.php:722
  PHPUnit_Framework_TestSuite->run() at /vendor/codeception/codeception/src/Codeception/PHPUnit/Runner.php:106
  Codeception\PHPUnit\Runner->doEnhancedRun() at /vendor/codeception/codeception/src/Codeception/SuiteManager.php:157
  Codeception\SuiteManager->run() at /vendor/codeception/codeception/src/Codeception/Codecept.php:184
  Codeception\Codecept->runSuite() at /vendor/codeception/codeception/src/Codeception/Codecept.php:175
  Codeception\Codecept->run() at /vendor/codeception/codeception/src/Codeception/Command/Run.php:376
  Codeception\Command\Run->runSuites() at /vendor/codeception/codeception/src/Codeception/Command/Run.php:303
  Codeception\Command\Run->execute() at /vendor/symfony/console/Command/Command.php:264
  Symfony\Component\Console\Command\Command->run() at /vendor/symfony/console/Application.php:874
  Symfony\Component\Console\Application->doRunCommand() at /vendor/symfony/console/Application.php:228
  Symfony\Component\Console\Application->doRun() at /vendor/symfony/console/Application.php:130
  Symfony\Component\Console\Application->run() at /vendor/codeception/codeception/src/Codeception/Application.php:103
  Codeception\Application->run() at /vendor/codeception/codeception/codecept:36

  run [-o|--override OVERRIDE] [-e|--ext EXT] [--report] [--html [HTML]] [--xml [XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--coverage-crap4j [COVERAGE-CRAP4J]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-x|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--no-rebuild] [--] [<suite>] [<test>]
John Stennett
  • 546
  • 3
  • 9
  • 1
    After digging around the repo for Allure-Codeception I found a commit that is breaking our framework: https://github.com/allure-framework/allure-codeception/commit/5088ee4f7a6f76dfc4d664d4d2ac8ebd2697de01 – John Stennett Aug 24 '17 at 16:29
  • After looking over the Allure change that occurred I have a temporary solution to the issue. Edit the following file: `vendor/allure-framework/allure-codeception/src/Yandex/Allure/Adapter/AllureAdapter.php` and add the following line below line 83 (Below the comment "// Add custom ignored annotations") in the *_initialize* function: `$ignoredAnnotations = $this->tryGetOption('ignoredAnnotations', []);` – John Stennett Aug 24 '17 at 18:43
  • You should made a pull request to https://github.com/allure-framework/allure-codeception – Naktibalda Aug 25 '17 at 07:35

0 Answers0