Giter Site home page Giter Site logo

Comments (10)

dxops avatar dxops commented on June 8, 2024 1

Just rename them to *TestCase

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

I've already encountered this issue.
Right now, the main issue is that I don't read inside the test files like PHPUnit does, so I'm not able to discern abstract from non-abstract classes. I solved this issue before with a naming convention, making abstract classes not caught up by the prefix/suffix settings of PHPUnit.

I'm open to suggestions; if anyone has an approach to avoid those problems, I'm all ears!

from paraunit.

dxops avatar dxops commented on June 8, 2024

We follow Symfony convention too.

Prefix abstract classes with Abstract. Please note some early Symfony classes do not follow this convention and have not been renamed for backward compatibility reasons. However all new abstract classes must follow this naming convention;

I think it's ok to make this prefix default one

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

Then, you can hotfix this changing the XML config, blacklisting the tests that have this prefix, right?
I'm not sure if blacklisting by default in Paraunit is a good idea, I can't assume that that convention is always used; as an example, I have a AbstractEntityTest.php in a project of mine, but the test is not abstract, the tested class is (well, the tested features, through child classes).

from paraunit.

dxops avatar dxops commented on June 8, 2024

Ok, but let's leave this issue open, just not to forget to skip abstract test suites somehow (check using AST maybe?)

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

I don't know how to do that, and I'm from mobile so my Google-fu is somewhat limited right now..but definitely yes, I don't want to close this issue.

I would like to remove abstract test classes from the execution queue beforehand, but only if that is possible without impacting too much on performances. Otherwise, I would prefer an other approach, just catching those cases afterwards, while analyzing the test outcome. I need to investigate what outcome I get via logs and exit code when I wrongly try to execute PHPUnit over an abstract test class.

from paraunit.

yisraeldov avatar yisraeldov commented on June 8, 2024

@Jean85

This could just take avanage of phpunit's parsing.

phpunit --list-tests

That will give you all the runable tests.

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

Thanks @yisraeldov but unfortunately that outputs the FQCN, which is no use for Paraunit: I cannot launch tests from the class name, I need the file name...

from paraunit.

dxops avatar dxops commented on June 8, 2024

@Jean85 https://blog.wyrihaximus.net/2016/10/utilizing-composers-classloader-to-get-a-class-contents/

from paraunit.

Jean85 avatar Jean85 commented on June 8, 2024

That unfortunately iwouldn't always work. PHPUnit works event with classes that have broken the PSR-0/4 autoloader, or even files that do not contains classes, like the PHPT tests. That would not work with that approach.

OTOH, it would be possible to parse that output anyway and act on it, but I fear that it would be slow...

from paraunit.

Related Issues (20)

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.