Coder Social home page Coder Social logo

psalm / codeception-psalm-module Goto Github PK

View Code? Open in Web Editor NEW
5.0 6.0 8.0 134 KB

Codeception module providing assertions and Gherkin snippets to help with Psalm acceptance testing

License: MIT License

PHP 71.80% Gherkin 28.20%
psalm codeception codeception-module

codeception-psalm-module's People

Contributors

adrienlucas avatar boesing avatar dependabot[bot] avatar lctrs avatar mr-feek avatar muglug avatar signpostmarv avatar weirdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

codeception-psalm-module's Issues

Tests fail because totallyTyped is now deprecated in 4.x

Error when running tests:

1) Psalm module: Running with no errors
 Test  tests/acceptance/PsalmModule.feature:Running with no errors
 Step  Can see no errors 
 Fail  There were errors: 
| ConfigIssue | Attribute "totallyTyped" is deprecated and is going to be removed in the next major version |

Bump requirements

Can you please bump the requirements of this lib.

The easy one is

"composer/semver": "^1.4 || ^2.0 || ^3.0"

Allow invoking psalm with xdebug enabled

๐Ÿ‘‹
Idea: Allow invoking psalm with xdebug enabled so that we can debug codeception tests. This is very helpful for me while writing new functionality in the laravel plugin.

The cmd will need to be changed to something like PSALM_ALLOW_XDEBUG=1 /usr/local/bin/php ' . $this->config['psalm_path'] ... This works for me locally, but I'm not sure if it will work cross platform, etc.

I think we will also need to set vendor/vimeo/psalm/src/psalm.php as the psalm path, instead of just vendor/bin/psalm

query re: code coverage

Having a bit of a problem at the dayjob; have got this psalm module integrated with a plugin for tests, but getting 0% coverage despite tests passing.

Any ideas where I might go looking?

I see no errors does not check if psalm ran successfully

If the psalm process executed does not run successfully, the codeception test will still pass.

Here is some output from a plugin test that I was developing, with --debug.

 When i run psalm
   I run psalm
  Moved to /Users/fiachra/repos/psalm-plugin-laravel/tests/_run
  Current version: 3.10.1
  Comparing 3.10.1.0 >= 3.4.0.0 => 1
  Running: /Users/fiachra/repos/psalm-plugin-laravel/vendor/vimeo/psalm/psalm --output-format=json  --no-progress
PHP Fatal error:  Cannot declare class Illuminate\Support\Collection, because the name is already in use in /Users/fiachra/repos/psalm-plugin-laravel/src/Stubs/Collection.stubphp on line 11

  Fatal error: Cannot declare class Illuminate\Support\Collection, because the name is already in use in /Users/fiachra/repos/psalm-plugin-laravel/src/Stubs/Collection.stubphp on line 11

  In Collection.stubphp line 11:

    Cannot declare class Illuminate\Support\Collection, because the name is already in use



  Moved to /Users/fiachra/repos/psalm-plugin-laravel
 Then i see no errors
   I can see no errors
 PASSED

I would expect this codeception test to fail. If the debug flag is not passed, then there is no indication that psalm did not run successfully.

Add `--no-cache` to psalm commands

Hey there,

I recently stumbled upon a problem which I wanted to fix. I debugged stuff, etc. and while debugging I was using --no-cache and was unable to reproduce the problem. I then found out that psalm is executed without --no-cache here which is kinda problematic in some cases (i.e. when using codecept run --fail-fast which keeps the _run directory).

I'd like to propose adding --no-cache to the psalm CLI execution command so that there are no sideeffects from whatever caches.

Test Marked As Passed Even If Different Error Type Is Returned

๐Ÿ‘‹ I noticed that my Codeception tests pass even if I expect a different type of error from psalm.

Steps To Reproduce
Write a gherkin test snippet and include Then I see these errors in the test. Expect a specific error such as | MissingFile | Cannot find file | when require_once file/that/doesn't/exist.php is analyzed.

An example is here: psalm/psalm-plugin-laravel@d69377b#diff-dc52f1aabf7e9388e148c112a4b349c1R32

Expected

  • Test fails because UnresolvableInclude was returned by psalm instead of the expected MissingFile

Actual

  • Test passes

query: re psalm cache & docker

Running codecept via a docker run command in a Makefile with the --user $(shell id -u):$(shell id -g) command seems to have your codeception psalm function be unable to create cache directories, despite psalm having no issue creating cache directories when run directly under a similar command.

Is there something in particular I'm missing here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.