Codeception: Incomplete stack trace on exception (-vvv doesn't work with --debug)

Created on 26 May 2018  ยท  4Comments  ยท  Source: Codeception/Codeception

What are you trying to achieve?

I'm trying to debug a failure in one of my tests.

What do you get instead?

The stack trace of the exception seems to be incomplete. For example I get this:

1) EntityLoaderPresenterTraitTest: Store restore request
 Test  tests\functional\src\EntityLoaderPresenterTraitTest.php:testStoreRestoreRequest

  [TypeError] Argument 2 passed to Contributte\Events\Extra\Event\Application\PresenterShutdownEvent::__construct() must be an instance of Nette\Application\IResponse, null given, called in H:\Packages\arachne\entity-loader\tests\_temp\integration\cache\Nette.Configurator\Container_62c09d655d.php on line 355  

#1  H:\Packages\arachne\entity-loader\vendor\contributte\event-dispatcher-extra\src\Event\Application\PresenterShutdownEvent.php:20
#2  H:\Packages\arachne\entity-loader\tests\_temp\integration\cache\Nette.Configurator\Container_62c09d655d.php:355
#3  Container_62c09d655d->{closure}
#4  H:\Packages\arachne\entity-loader\vendor\nette\utils\src\Utils\Callback.php:75
#5  H:\Packages\arachne\entity-loader\vendor\nette\utils\src\Utils\SmartObject.php:41
#6  H:\Packages\arachne\entity-loader\vendor\nette\application\src\Application\UI\Presenter.php:251
#7  H:\Packages\arachne\entity-loader\vendor\nette\application\src\Application\Application.php:145
#8  H:\Packages\arachne\entity-loader\vendor\nette\application\src\Application\Application.php:83
#9  H:\Packages\arachne\entity-loader\vendor\arachne\codeception\src\Connector\NetteConnector.php:66
#10 H:\Packages\arachne\entity-loader\vendor\symfony\browser-kit\Client.php:312

But where was the Client from Symfony BroweserKit called from?? It looks like the stack trace is limited to last 10 records or something. I need a complete stack trace.

I found a question on StackOverflow: https://stackoverflow.com/questions/49314335/show-more-than-10-calls-in-codeception-stack-trace

The solution there suggests adding -vvv. I of course tried that even before I found that question. It did not help.

Details

  • Codeception version: 2.4.1
  • PHP Version: 7.2.5
  • Operating System: Win 10
  • Installation type: Composer
  • List of installed packages (composer show)
arachne/codeception                v0.8.1  Integration of Nette framework to Codeception.
arachne/service-collections        v0.2.0  Resolvers and iterators over services for nette/di. Used by arachne/forms and other libraries.
behat/gherkin                      v4.5.1  Gherkin DSL parser for PHP 5.3
codeception/codeception            2.4.1   BDD-style testing framework
codeception/phpunit-wrapper        7.1.3   PHPUnit classes used by Codeception
codeception/stub                   1.0.4   Flexible Stub wrapper for PHPUnit's Mock Builder
composer/semver                    1.4.2   Semver library that offers utilities, version constraint parsing and validation.
contributte/cache                  v0.1    Extra contrib to nette/cache
contributte/event-dispatcher       v0.4    Best event dispatcher / event manager / event emitter for Nette Framework
contributte/event-dispatcher-extra v0.3    Nette-based Symfony events for application, presenter, form, latte, templates, security and many others.
doctrine/annotations               v1.6.0  Docblock Annotations Parser
doctrine/instantiator              1.1.0   A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                     v1.0.1  Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
eloquent/phony                     3.0.0   Mocks, stubs, and spies for PHP.
eloquent/phony-phpunit             4.0.1   Phony for PHPUnit.
eloquent/phpstan-phony             0.1.1   PHPStan configuration for Phony.
facebook/webdriver                 1.6.0   A PHP client for Selenium WebDriver
friendsofphp/php-cs-fixer          v2.11.1 A tool to automatically fix PHP code style
guzzlehttp/guzzle                  6.3.3   Guzzle is a PHP HTTP client library
guzzlehttp/promises                v1.3.1  Guzzle promises library
guzzlehttp/psr7                    1.4.2   PSR-7 message implementation that also provides common utility methods
jean85/pretty-package-versions     1.1     A wrapper for ocramius/pretty-package-versions to get pretty versions strings
myclabs/deep-copy                  1.7.0   Create deep copies (clones) of your objects
nette/application                  v2.4.12 ๐Ÿ† Nette Application: a full-stack component-based MVC kernel for PHP that helps you write powerful and modern web applications. Write less, have cleaner code and your work will bring you joy.
nette/bootstrap                    v2.4.6  ๐Ÿ…ฑ Nette Bootstrap: the simple way to configure and bootstrap your Nette application.
nette/caching                      v2.5.8  โฑ Nette Caching: library with easy-to-use API and many cache backends.
nette/component-model              v2.4.0  โš› Nette Component Model
nette/di                           v2.4.12 ๐Ÿ’Ž Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.
nette/finder                       v2.4.1  Nette Finder: Files Searching
nette/forms                        v2.4.7  ?? Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server & client side validation and mature design.
nette/http                         v2.4.9  ๐ŸŒ Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.
nette/neon                         v2.4.2  Nette NEON: parser & generator for Nette Object Notation
nette/php-generator                v3.0.4  ๐Ÿ˜ Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.
nette/reflection                   v2.4.2  Nette Reflection: docblock annotations parser and common reflection classes
nette/robot-loader                 v3.0.3  ๐Ÿ€ Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.
nette/security                     v2.4.3  ๐Ÿ”‘ Nette Security: provides authentication, authorization and a role-based access control management via ACL (Access Control List)
nette/utils                        v2.5.2  ๐Ÿ›  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.
nextras/secured-links              v1.4.0  Package secures Nette Framework signals against CSRF attack.
nikic/php-parser                   v3.1.5  A PHP parser written in PHP
ocramius/package-versions          1.3.0   Composer plugin that provides efficient querying for installed package versions (no runtime IO)
paragonie/random_compat            v2.0.12 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phar-io/manifest                   1.0.1   Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                    1.0.1   Library for handling version information and constraints
php-cs-fixer/diff                  v1.3.0  sebastian/diff v2 backport support for PHP5.6
phpdocumentor/reflection-common    1.0.1   Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock  4.3.0   With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver        0.4.0
phpspec/prophecy                   1.7.6   Highly opinionated mocking framework for PHP 5.3+
phpstan/phpdoc-parser              0.2     PHPDoc parser with support for nullable, intersection and generic types
phpstan/phpstan                    0.9.2   PHPStan - PHP Static Analysis Tool
phpstan/phpstan-nette              0.9     Nette Framework class reflection extension for PHPStan
phpunit/php-code-coverage          6.0.4   Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator          1.4.5   FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template          1.2.1   Simple template engine.
phpunit/php-timer                  2.0.0   Utility class for timing
phpunit/php-token-stream           3.0.0   Wrapper around PHP's tokenizer extension.
phpunit/phpunit                    7.1.5   The PHP Unit Testing framework.
phpunit/phpunit-mock-objects       6.1.1   Mock Object library for PHPUnit
psr/http-message                   1.0.1   Common interface for HTTP messages
sebastian/code-unit-reverse-lookup 1.0.1   Looks up which function or method a line of code belongs to
sebastian/comparator               3.0.0   Provides the functionality to compare PHP values for equality
sebastian/diff                     3.0.0   Diff implementation
sebastian/environment              3.1.0   Provides functionality to handle HHVM/PHP environments
sebastian/exporter                 3.1.0   Provides the functionality to export PHP variables for visualization
sebastian/global-state             2.0.0   Snapshotting of global state
sebastian/object-enumerator        3.0.3   Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector         1.1.1   Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context        3.0.0   Provides functionality to recursively process PHP variables
sebastian/resource-operations      1.0.0   Provides a list of PHP built-in functions that operate on resources
sebastian/version                  2.0.1   Library that helps with managing the version number of Git-hosted PHP projects
symfony/browser-kit                v4.0.11 Symfony BrowserKit Component
symfony/console                    v4.0.11 Symfony Console Component
symfony/css-selector               v4.0.11 Symfony CssSelector Component
symfony/dom-crawler                v4.0.11 Symfony DomCrawler Component
symfony/event-dispatcher           v4.0.11 Symfony EventDispatcher Component
symfony/filesystem                 v4.0.11 Symfony Filesystem Component
symfony/finder                     v4.0.11 Symfony Finder Component
symfony/options-resolver           v4.0.11 Symfony OptionsResolver Component
symfony/polyfill-ctype             v1.8.0  Symfony polyfill for ctype functions
symfony/polyfill-mbstring          v1.8.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php70             v1.8.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-php72             v1.8.0  Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/process                    v4.0.11 Symfony Process Component
symfony/stopwatch                  v4.0.11 Symfony Stopwatch Component
symfony/yaml                       v4.0.11 Symfony Yaml Component
theseer/tokenizer                  1.1.0   A small library for converting tokenized PHP source code into XML and potentially other formats
webmozart/assert                   1.3.0   Assertions to validate method input/output with nice error messages.
  • Suite configuration:
error_level: "E_ALL"

class_name: FunctionalSuiteTester

modules:
    enabled:
        - Arachne\Codeception\Module\NetteApplicationModule
        - Arachne\Codeception\Module\NetteDIModule:
            tempDir: ../_temp/integration
            removeDefaultExtensions: true
            configFiles:
                - config/config.neon
BUG Minor

Most helpful comment

Strange, --debug is -vv

All 4 comments

Ok it turns out that -vvv actually does help but only when --debug is not used.

So this actually limits the stack trace to 10 records:

vendor/bin/codecept run --debug -vvv

Strange, --debug is -vv

@DavertMik Then maybe --debug takes priority and -vvv is ignored? Not sure how many vs are needed for complete stack trace.

By the way is there any configuration to always force full exception stack even without -vvv?

@DavertMik thanks

Was this page helpful?
0 / 5 - 0 ratings