Problem/Motivation

Steps to reproduce

Go to application/web/modules/contrib/upgrade_status/tests/modules/upgrade_status_test_fatal/fatal.php
there is a non commented string "Fatal error" at line: 5

Proposed resolution

This line should be commented

Remaining tasks

This line should be commented

User interface changes

none

API changes

none

Data model changes

none

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

piyush.sharma0985 created an issue. See original summary.

gábor hojtsy’s picture

This is intended to cause a fatal error, that is what is being tested that Upgrade Status does not collapse on scanning a module with a PHP fatal error in it :) So not sure what you mean here? If we would comment out that line it would not cause the fatal error that we need.

mikemadison’s picture

Hey Gabor, when I'm trying to run PHPStan and Drupal Check and other tools on my contrib modules, they are all erring out on this specific test. I think your "fatal error" test is working a bit too well, unfortunately.

Not sure what we need to do to allow your fatal error testing to work, but what you're doing now is making a bunch of other automated scanning tools impossible in CI.

gábor hojtsy’s picture

@mikemadison: For example with PHPStan, you can ignore errors or whole files and directories: https://phpstan.org/user-guide/ignoring-errors#excluding-whole-files, so you would run your tool in CI with configuration that ignores the test files of Upgrade Status. (You would probably want to ignore tests of contributed and core modules in general to speed up your CI, even if you want to keep checking tests of your own custom modules).

gábor hojtsy’s picture

Title: Uncommented String on test modules » PHPStan fails fatally when run on the module with a 3rd party system

I'm adding a custom phpstan.neon file with a baseline in the project, similar to other contrib projects. Whatever you use to run phpstan on Drupal codebases should consider these files as Drupal projects may define their own phpstan rules / exceptions. With this Gitlab CI runs phpstan fine. I am also resolving a bunch of the simpler ones in this MR, so it gets closer to be useful. (Not going to fix all since some are related to DrupalFinder deprecations, which probably is better on its own as it may change the compatibility of the project with PHP or Drupal core too).

gábor hojtsy’s picture

Title: PHPStan fails fatally when run on the module with a 3rd party system » PHPStan fails fatally when run on the module with systems such as Gitlab CI

  • gábor hojtsy committed 05ac4c56 on 4.x
    Issue #3534859: PHPStan fails fatally when run on the module with...
gábor hojtsy’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.