Sitelet https://github.com/Codeception/Codeception/issues/4871
Skip to content

Codeception shows 502 bad gateway when running acceptance test with codecoverage #4871

Description

@petrabarus

What are you trying to achieve?

I am trying to run acceptance test with code coverage.

What do you get instead?

When I don't use code coverage it works normal. But when I use it, it returns error. I checked in the NGINX log, turns out it requests one page two times where the second one returns 502.

Here's the NGINX log.

172.19.0.1 - - [15/Mar/2018:20:37:36 +0700]"GET /c3/report/clear HTTP/1.0" 200 0"-" "-" "-""0.002"
172.19.0.1 - - [15/Mar/2018:20:37:37 +0700]"GET / HTTP/1.1" 302 5"-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36" "-""0.031"
172.19.0.1 - - [15/Mar/2018:20:37:37 +0700]"GET /login HTTP/1.1" 200 8865"-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36" "-""0.029"
172.19.0.1 - - [15/Mar/2018:20:37:37 +0700]"GET /login HTTP/1.1" 502 568"-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36" "-""0.168"

Provide console output if related. Use -vvv mode for more details.

$./vendor/bin/codecept run -vvv -c apps/admin/ acceptance --coverage-xml

Codeception PHP Testing Framework v2.4.0
Powered by PHPUnit 6.5.2 by Sebastian Bergmann and contributors.

Admin\tests.acceptance Tests (1) ---------------------------------------------------------------------------------------------------------------------
Modules: WebDriver
------------------------------------------------------------------------------------------------------------------------------------------------------
home: redirect to login if not authenticated
Signature: home:redirect to login if not authenticated
Test: tests/acceptance/home.feature:redirect to login if not authenticated
Scenario --
  [GET] http://localhost:7002/
  [Cookies] [{},{},{}]
 Given i am on login page 
   I am on page "/login"
  [GET] http://localhost:7002/login
 When i go to home page 
 Then i should be on login page 
 PASSED 

------------------------------------------------------------------------------------------------------------------------------------------------------


Time: 4.9 seconds, Memory: 10.00MB

OK (1 test, 0 assertions)


Code Coverage Report:      
  2018-03-15 20:48:14      
                           
 Summary:                  
  Classes:  0.00% (0/162)  
  Methods:  0.00% (0/1058) 
  Lines:    0.00% (0/17054)

Remote CodeCoverage reports are not printed to console

XML report generated in coverage.xml

Provide test source code if related

// paste test

Details

  • Codeception version: 2.4.0
  • Codeception C3 version: 2.0.14
  • PHP Version: PHP 7.0.22-0ubuntu0.16.04.1
  • Operating System: Ubuntu
  • Installation type: Composer
  • List of installed packages (composer show)
apache/thrift                       0.10.0             Apache Thrift RPC system
aws/aws-sdk-php                     3.38.5             AWS SDK for PHP - Use Amazon Web Services in your PHP project
behat/gherkin                       v4.5.1             Gherkin DSL parser for PHP 5.3
bower-asset/bootstrap               v3.3.7            
bower-asset/bootstrap-tagsinput     0.8.0             
bower-asset/bootstrap3-dialog       v1.35.4           
bower-asset/inputmask               3.3.11            
bower-asset/jquery                  2.1.4             
bower-asset/punycode                v1.3.2            
bower-asset/typeahead.js            v0.11.1           
bower-asset/yii2-pjax               2.0.7.1           
cebe/markdown                       1.1.2              A super fast, highly extensible markdown parser for PHP
codeception/base                    2.4.0              BDD-style testing framework
codeception/c3                      2.0.14             CodeCoverage collector for Codeception
codeception/phpunit-wrapper         6.0.5              PHPUnit classes used by Codeception
codeception/specify                 0.4.6              BDD code blocks for PHPUnit and Codeception
codeception/stub                    1.0.2              Flexible Stub wrapper for PHPUnit's Mock Builder
codeception/verify                  1.0.0              BDD assertion library for PHPUnit
creocoder/yii2-flysystem            0.8.1              The flysystem extension for the Yii framework
defuse/php-encryption               v2.1.0             Secure PHP Encryption Library
doctrine/instantiator               1.0.5              A small, lightweight utility to instantiate objects in PHP without invoking their construc...
doctrine/lexer                      v1.0.1             Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
egulias/email-validator             2.1.3              A library for validating emails against several RFCs
ezyang/htmlpurifier                 v4.10.0            Standards compliant HTML filter written in PHP
facebook/webdriver                  1.5.0              A PHP client for Selenium WebDriver
firebase/php-jwt                    v5.0.0             A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the ...
fzaninotto/faker                    v1.7.1             Faker is a PHP library that generates fake data for you.
google/apiclient                    v2.2.1             Client library for Google APIs
google/apiclient-services           v0.49              Client library for Google APIs
google/auth                         v1.2.1             Google Auth Library for PHP
guzzlehttp/guzzle                   6.3.0              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
kartik-v/bootstrap-checkbox-x       v1.5.4             An extended checkbox plugin for bootstrap with three states and additional styles.
kartik-v/bootstrap-fileinput        v4.4.7             An enhanced HTML 5 file input for Bootstrap 3.x with features for file preview for many fi...
kartik-v/bootstrap-popover-x        v1.4.4             Bootstrap Popover Extended - Popover with modal behavior, styling enhancements and more.
kartik-v/yii2-builder               v1.6.3             Build forms (single-row or multi-row/tabular) easily for Yii Framework 2.0
kartik-v/yii2-checkbox-x            v1.0.3             Extended checkbox widget for bootstrap with three states and additional styles.
kartik-v/yii2-date-range            1.6.8              An advanced Yii 2 date range picker input for based on bootstrap-daterangepicker plugin.
kartik-v/yii2-dialog                v1.0.3             An asset bundle for bootstrap3-dialog for Yii 2.0 framework.
kartik-v/yii2-editable              dev-master 5f4939a An enhanced editable widget for Yii 2.0 that allows easy editing of displayed data with nu...
kartik-v/yii2-grid                  v3.1.7             Yii 2 GridView on steroids. Various enhancements and utilities for the Yii 2.0 GridView wi...
kartik-v/yii2-helpers               v1.3.6             A collection of useful helper functions for Yii Framework 2.0
kartik-v/yii2-krajee-base           v1.8.9             Base library and foundation components for all Yii2 Krajee extensions.
kartik-v/yii2-money                 v1.2.2             An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Boots...
kartik-v/yii2-mpdf                  v1.0.1             A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded...
kartik-v/yii2-popover-x             v1.3.4             An extended bootstrap 3.0 popover widget which combines both the bootstrap popover and mod...
kartik-v/yii2-slider                v1.3.2             An advanced slider input for Yii Framework 2 for both touch enabled and desktop devices ba...
kartik-v/yii2-widget-activeform     dev-master 2807832 Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo s...
kartik-v/yii2-widget-datepicker     dev-master 9110ecc Enhanced Yii2 wrapper for the bootstrap datepicker plugin (sub repo split from yii2-widgets).
kartik-v/yii2-widget-datetimepicker v1.4.4             Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-wi...
kartik-v/yii2-widget-fileinput      v1.0.6             An enhanced FileInput widget for Bootstrap 3.x with file preview, multiple selection, and ...
kartik-v/yii2-widget-rangeinput     v1.0.1             An enhanced Yii 2 widget encapsulating the HTML 5 range input (sub repo split from yii2-wi...
kartik-v/yii2-widget-select2        v2.1.1             Enhanced Yii2 wrapper for the Select2 jQuery plugin (sub repo split from yii2-widgets).
kartik-v/yii2-widget-switchinput    v1.3.1             A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes & radios as toggle...
lcobucci/jwt                        3.2.2              A simple library to work with JSON Web Token and JSON Web Signature
league/event                        2.1.2              Event package
league/flysystem                    1.0.43             Filesystem abstraction: Many filesystems, one API.
league/flysystem-aws-s3-v3          1.0.18             Flysystem adapter for the AWS S3 SDK v3.x
league/oauth2-server                6.1.1              A lightweight and powerful OAuth 2.0 authorization and resource server library with suppor...
monolog/monolog                     1.23.0             Sends your logs to files, sockets, inboxes, databases and various web services
mormat/php-formula-interpreter      v1.0.0             Formula interpreter for PHP
mpdf/mpdf                           v6.1.4             A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support
mtdowling/jmespath.php              2.4.0              Declaratively specify how to extract elements from a JSON document
myclabs/deep-copy                   1.7.0              Create deep copies (clones) of your objects
paragonie/random_compat             v2.0.11            PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
pdepend/pdepend                     2.5.2              Official version of pdepend to be handled with Composer
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
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 otherw...
phpdocumentor/type-resolver         0.4.0             
phpmd/phpmd                         2.6.0              PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well know...
phpseclib/phpseclib                 2.0.10             PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.50...
phpspec/php-diff                    v1.1.0             A comprehensive library for generating differences between two hashable objects (strings o...
phpspec/prophecy                    1.7.5              Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage           5.2.3              Library that provides collection, processing, and rendering functionality for PHP code cov...
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                   1.0.9              Utility class for timing
phpunit/php-token-stream            2.0.2              Wrapper around PHP's tokenizer extension.
phpunit/phpunit                     6.5.2              The PHP Unit Testing framework.
phpunit/phpunit-mock-objects        5.0.6              Mock Object library for PHPUnit
psr/cache                           1.0.1              Common interface for caching libraries
psr/container                       1.0.0              Common Container Interface (PHP FIG PSR-11)
psr/http-message                    1.0.1              Common interface for HTTP messages
psr/log                             1.0.2              Common interface for logging libraries
sebastian/code-unit-reverse-lookup  1.0.1              Looks up which function or method a line of code belongs to
sebastian/comparator                2.1.3              Provides the functionality to compare PHP values for equality
sebastian/diff                      2.0.1              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
setasign/fpdi                       1.6.2              FPDI is a collection of PHP classes facilitating developers to read pages from existing PD...
slevomat/coding-standard            4.0.0              Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by pr...
squizlabs/php_codesniffer           3.1.1              PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a define...
swiftmailer/swiftmailer             v6.0.2             Swiftmailer, free feature-rich PHP mailer
symfony/browser-kit                 v3.4.5             Symfony BrowserKit Component
symfony/config                      v3.4.5             Symfony Config Component
symfony/console                     v3.4.5             Symfony Console Component
symfony/css-selector                v3.4.5             Symfony CssSelector Component
symfony/debug                       v3.4.5             Symfony Debug Component
symfony/dependency-injection        v3.4.5             Symfony DependencyInjection Component
symfony/dom-crawler                 v3.4.5             Symfony DomCrawler Component
symfony/event-dispatcher            v3.4.5             Symfony EventDispatcher Component
symfony/filesystem                  v3.4.5             Symfony Filesystem Component
symfony/finder                      v3.4.5             Symfony Finder Component
symfony/polyfill-mbstring           v1.7.0             Symfony polyfill for the Mbstring extension
symfony/process                     v3.4.5             Symfony Process Component
symfony/yaml                        v3.4.5             Symfony Yaml Component
theseer/tokenizer                   1.1.0              A small library for converting tokenized PHP source code into XML and potentially other fo...
urbanindo/yii2-thrift               v2.0               Thrift server application using Yii2
vlucas/phpdotenv                    v2.4.0             Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
wbraganca/yii2-dynamicform          dev-master fa1fec0 It is widget to yii2 framework to clone form elements in a nested manner, maintaining acce...
wbraganca/yii2-tagsinput            1.0.2              The yii2-tagsinput is a Yii 2 wrapper for [bootstrap-tagsinput](https://github.com/timschl...
webmozart/assert                    1.3.0              Assertions to validate method input/output with nice error messages.
yiisoft/yii2                        2.0.14.1           Yii PHP Framework Version 2
yiisoft/yii2-bootstrap              2.0.8              The Twitter Bootstrap extension for the Yii framework
yiisoft/yii2-composer               2.0.5              The composer plugin for Yii extension installer
yiisoft/yii2-debug                  2.0.13             The debugger extension for the Yii framework
yiisoft/yii2-faker                  2.0.4              Fixture generator. The Faker integration for the Yii framework.
yiisoft/yii2-gii                    2.0.6              The Gii extension for the Yii framework
yiisoft/yii2-swiftmailer            2.1.0              The SwiftMailer integration for the Yii framework
  • Suite configuration:
#acceptance.suite.yml
actor: AcceptanceTester
bootstrap: false
modules:
    enabled:
        - WebDriver:
            url: 'http://localhost:7002' #for local
            #url: 'http://web:7002/'  #for docker
            host: localhost
            #host: selenium
            port: 4444
            browser: chrome

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions