Open jubianchi opened 11 years ago
:+1:
:+1:
Of course :) someone started it already ?
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.
:+1:
why bundles configuration ? is it really needed (is it for coverage etc ?) ?
This is useful to launch tests of each bundles which contains atoum tests. (via app/console atoum command).
can't it seek for all registered bundles ?? I don't see the need to add config for the test env.
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
.
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.
@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.
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.
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
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)
@ludofleury did you try using a bootstrap file (including it in all tests) which would include the app/autoload ?
Maybe we could provide an option for the bootstrap file in the command (and use a generic bootstrap file if none provided)
Yes, bootstrap file + configuration file.
It's a bundle in a Symfony Context, we should rely on composer autoload for this no ?
Using a default bootstrap file integrated on AtoumBundle would be great.
I think this ticket can be close, isn't it?
It would be really nice to have a native SF2 command to launch test on a bundle :