-
-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPStan producing different results on CI #2269
Comments
Hi, this looks like the extension isn't properly loaded. I guess that you have Please verify that you're running the same versions of PHPStan and extensions locally and in the CI, or for example try to clean PHPStan cache. There's definitely something different about the CI environment. |
Hi @ondrejmirtes - the CI runs a clean install with a Docker image each time; I've replicated the same set up both locally and in the other project. Composer update has been run. How could it not install the extension properly? And yes, I'm using
|
I have no idea. Do you install PHPStan with extensions in project's composer.json or globally in the project? Can I help you specifically with this codebase? Can we arrange remote desktop session or something like that? |
@ondrejmirtes Unfortunately not, it's with a company I'm contracting with, so proprietary code. The project's composer json contains in dev
Where is the phpstan cache? Maybe if I clear that locally I can reproduce.... It's also not the first time I've had different results on GoCD and locally with the same Docker instance. |
First thing I'd try is to remove |
@ondrejmirtes Will try that. |
Ok - now the other project is failing.... only on the CI server. Huh? :( (I'd done a composer update to get the latest stan, but it failed before that on a minor push that had nothing to do with stan). However; removing the extension installer and adding the rules manually to the config on the first failing project - that's fixed it. So something weird is going on with the extension installer..... Is it run in a composer script? How do I force it to run? |
Yes, I guess it depends on how many times and when you call composer... Possibly related: phpstan/extension-installer#5 |
Ah. Now that makes sense. It's annoying - but it makes some sense. Any way to force it to run? |
Add |
Closing since it's solved. The extension-installer has narrow usefulness, once you step outside the "happy path", you probably can't use it... |
@ondrejmirtes Really seriously appreciate the help though!! thanks 👍 |
phpstan/extension-installer now uses relative paths as of 1.1.0 + phpstan/phpstan 0.12.62. So you can give it a shot again :) See: phpstan/extension-installer#17 (comment) |
Support question
I have two projects set up using PHPStan. They are both using a Docker container as an image to run stan and unit tests etc again, both locally and on a CI service (GoCD). I have Stan set to max level, the config set up and the phpunit extension installed (and the extensions installer)
I'm running Stan against my tests locally using the Docker image and there are no problems on both projects - which each have a similar test and set up.
On GoCD - one project is failing, one is passing. Locally, both are passing. They are all using the same Docker container, cache cleared and freshly built.
The errors on GoCD are:
Namespaces are included properly. PHPUnit extension included. I've compared against the other project. And as I said it's running fine locally. Also - those methods do exist (and the test runs fine.
Can you think of anything that would cause two different sets of results so I can try and reproduce this locally - as it's really annoying having to commit every potential fix and have it fail again.
An easy fix would be to remove the docblock @var declarations for the test. But as the same test is passing on the other project; I feel like it's something different causing it to fail.
The text was updated successfully, but these errors were encountered: