Skip to content

Output is truncated, showing exception from this package instead of problem in test. #313

@mikebronner

Description

@mikebronner
❯ pa test --parallel

  .......⨯......................................................⨯.......................
  .........................................................
  ──────────────────────────────────────────────────────────────────────────────────────  
   FAILED  Tests\Legacy\Http\Controllers\Api\Legacy\LeadSettings\LeadProviders</>…  Error   
  Unknown named parameter $daily_cap_error_msg

   TypeError 

  str_replace(): Argument #3 ($subject) must be of type array|string, null given

  at vendor/nunomaduro/collision/src/Writer.php:179
    175▕ 
    176▕                     foreach ($this->ignore as $ignore) {
    177▕                         if (is_string($ignore)) {
    178▕                             // Ensure paths are linux-style (like the ones on $this->ignore)
  ➜ 179▕                             $sanitizedPath = (string) str_replace('\\', '/', $frame->getFile());
    180▕                             if (preg_match($ignore, $sanitizedPath)) {
    181▕                                 return false;
    182▕                             }
    183▕                         }

      +1 vendor frames 

  2   [internal]:0
      NunoMaduro\Collision\Writer::NunoMaduro\Collision\{closure}()
      +5 vendor frames 

  8   [internal]:0
      NunoMaduro\Collision\Adapters\Phpunit\Style::NunoMaduro\Collision\Adapters\Phpunit\{closure}()

We are using this package along with PestPHP and are having the following issues as can be seen in the above error:

  1. The error is confusing, as it is showing the point of failure in the package. In dumping the $frame object, the file property is an empty string. Is this an error with the package, shouldn't it be able to process that if an empty string is a valid value for the file property in the frame object.
  2. The output is truncated to one line. This makes it very difficult to use effectively for debugging. Fully printed file paths with line numbers allow option-clicking to go directly to the test in question. Aside from that, when the output is truncated, we have no way to expand it to show actionable information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions