Skip to content
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

Add a command to launch tests of a bundle #9

Open
jubianchi opened this issue Dec 19, 2012 · 20 comments
Open

Add a command to launch tests of a bundle #9

jubianchi opened this issue Dec 19, 2012 · 20 comments

Comments

@jubianchi
Copy link
Member

It would be really nice to have a native SF2 command to launch test on a bundle :

$ app/console atoum @AcmeBundle
@stephpy
Copy link
Member

stephpy commented Dec 19, 2012

👍

1 similar comment
@BenoitLeveque
Copy link

👍

@ludofleury
Copy link
Contributor

Of course :) someone started it already ?

@stephpy
Copy link
Member

stephpy commented Jan 8, 2013

I can look at this asap, we discuss about this with @jubianchi, having:

in config.yml

atoum:
    bundles: [FooBundle, BarBundle]
$ app/console atoum @FooBundle
$ app/console atoum # launch all bundles configured.

@jubianchi
Copy link
Member Author

👍

@ludofleury
Copy link
Contributor

why bundles configuration ? is it really needed (is it for coverage etc ?) ?

@stephpy
Copy link
Member

stephpy commented Jan 8, 2013

This is useful to launch tests of each bundles which contains atoum tests. (via app/console atoum command).

@ludofleury
Copy link
Contributor

can't it seek for all registered bundles ?? I don't see the need to add config for the test env.

@stephpy
Copy link
Member

stephpy commented Jan 8, 2013

We'll have to define if tests are atoum or phpunit or other ..., why not.

But IMO, i would prefer to launch tests of MY bundles, having fail tests on bundles which are not mine is so boring ...

For sure, this config has to be on config_test.yml.

@stephpy
Copy link
Member

stephpy commented Jan 8, 2013

We keep in mind to add some other configurations, like the storage(orm, odm, propel, propel2, etc...) to propose annotations for refresh database or load fixtures.

@jubianchi
Copy link
Member Author

@ludofleury : seeking among registered bundles can quickly become a pain as, as @stephpy said, we don't know which test framework is used in which bundle and sniffing it would add, to me, useless and painful to maintain code.

In my mind, when I submitted this feature request, it was only intended to run tests for bundles laying in src/ but @stephpy suggested that it would also be cool, in some cases, to launch every bundle's test suite with only one command.

So, I think the config is the most secure and esay way to get best of both worlds and it could be optional, letting AtoumBundle trigger only certain suites.

@mageekguy
Copy link

I think that it's must be a good idea to launch tests of ALL bundles even if they are not write with atoum.
It's a good solution to check if the environment is ok when you install a software.
But sure that it's not easy to do a launcher which can handle PHPUnit tests and atoum tests.

@stephpy
Copy link
Member

stephpy commented Jan 9, 2013

Yes, and user may just want to launch his tests, or it could be configurable.

By doing a configuration, we reinvent the wheel, it's may be more useful to show some examples of .atoum.php configuration files, by this way, user could launch:

$ bin/console atoum --c=.atoum.all.php

@ludofleury
Copy link
Contributor

It's kinda related to this issue, but Atoum Bundle (and the sf command) do not support the requirement of app/autoload.php ???

How should I deal with this in this bundle ? (I don't want to require in each test classes)

@jubianchi
Copy link
Member Author

@ludofleury did you try using a bootstrap file (including it in all tests) which would include the app/autoload ?

@FlorianLB
Copy link
Member

Maybe we could provide an option for the bootstrap file in the command (and use a generic bootstrap file if none provided)

@stephpy
Copy link
Member

stephpy commented Mar 5, 2013

Yes, bootstrap file + configuration file.

@ludofleury
Copy link
Contributor

It's a bundle in a Symfony Context, we should rely on composer autoload for this no ?

@stephpy
Copy link
Member

stephpy commented Mar 5, 2013

Using a default bootstrap file integrated on AtoumBundle would be great.

@FlorianLB FlorianLB modified the milestones: 1.2, 1.1 Nov 30, 2014
@jubianchi jubianchi modified the milestone: 1.2 Nov 18, 2016
@maxailloud
Copy link
Contributor

I think this ticket can be close, isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants