-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Reverting the removal of the tests via .gitattributes #6605
Comments
Original pull request: #5674 |
And the issue that started it: #6047 |
Same as @marijn, tests are part of the documentation, and have proved more than useful to understand how internals are working. Also I like to run the tests when putting my application on production, just to ensure that my server environnement doesn't break them. |
I totally support this. Moreover I think that the test base of symfony is great and we need to encourage people to learn from it rather than hiding it. 👍 |
To clarify the intent of the original PR: The idea is make the stable, zipped packages optimized for deployment. That means stripping out things like docs and tests that are not needed in production. When this is applied on a large scale, the savings are significant. Of course stable packages are also used in development, and as such having the documentation present can be very useful. For the record, I have no problem reverting this. Stable packages != production; stripping out useless things in the deployment process is a sane approach. The fact that composer caches packages locally also helps for speed and bandwidth. 👍 |
I tend to agree it probably causes more pain than good. I fixed composer docs to avoid promoting the practice, because I have seen it spread quite a bit lately composer/composer@bf32869 |
@fabpot - I think it's all about the target audience. If you are deploying a project, the tests are not necessary. if you are working in a development environment, then you certainly want the tests but you'd get them anyway with Composer which you'd sure be using when developing a project... |
Thinking some more, when you have to package a large project it's usually necessary do some assembly and packaging tasks anyhow, so it probably doesn't matter either way. If tests are considered part of the documentation, then +1 for keeping them. What consumers do downstream when packaging their final products is their own prerogative. +1 for reverting the PR. |
+1 for reverting this, I look a lot at the tests to see how the code works, not everything is in the docs! |
One thing worth noting is that test helper classes and such that are |
I strongly agree with @Seldaek, the tests are not a public API and should not be depended on. |
I agree too with Seldaek and I won't revert the move of some test classes. If some others need to be moved, let's do it. |
done |
* 2.1: [Yaml] fixed default value Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes. added a way to enable/disable object support when parsing/dumping added a way to enable/disable PHP support when parsing a YAML input via Yaml::parse() fixed CS [Process] Fix docblocks, remove `return` from `PhpProcess#start()` as parent returns nothing, cleaned up `ExecutableFinder` fixes a bug when output/error output contains a % character [Console] fixed input bug when the value of an option is empty (closes #6649, closes #6689) [Profiler] [Redis] Fix sort of profiler rows. Fix version_compare() calls for PHP 5.5. Removed underscores from test method names to be consistent with other components. [Process] In edge cases `getcwd()` can return `false`, then `proc_open()` should get `null` to use default value (the working dir of the current PHP process) Fix version_compare() calls for PHP 5.5. Handle the deprecation of IntlDateFormatter::setTimeZoneId() in PHP 5.5. removed the .gitattributes files (closes #6605, reverts #5674) [HttpKernel] Clarify misleading comment in ExceptionListener Conflicts: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_style.html.twig src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php src/Symfony/Component/Form/Tests/Util/PropertyPathTest.php src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php src/Symfony/Component/Process/Process.php
If people intend to run tests/look at tests when developing, they can also install vendors locally with --prefer-source and when deploying on servers with --prefer-dist. |
I agree with @Tobion If the gitattributes are restored, you get the best of both options. Use This seems like it would solve both side elegantly, so why not do it? In my opinion, if you want the code is a deploy-able/library state, that is what composer is for. If you want the code in a develop-able state, that is what |
I don't understand how the benefits and drawbacks were weighted here; ignoring parts of the package which are not required to use it seems like a no-brainer to me. People using them for development/CI should use |
having tests to understand code argument: Tests are not going anywhere, it is only for -prefer-dist Besides the little probability of changing minds here i want to leave a trace to accomplish no tests on deployments one has to write a script to rm -rf Tests folder on every first level component provided one is not requiring symfony/symfony and is requiring symfony/framework-bundle instead with the use of composer replace key. |
I'm removing tests and docs as part of a deploy procedure. |
This discussion already happened in #17749 |
* 2.1: [Yaml] fixed default value Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes. added a way to enable/disable object support when parsing/dumping added a way to enable/disable PHP support when parsing a YAML input via Yaml::parse() fixed CS [Process] Fix docblocks, remove `return` from `PhpProcess#start()` as parent returns nothing, cleaned up `ExecutableFinder` fixes a bug when output/error output contains a % character [Console] fixed input bug when the value of an option is empty (closes symfony#6649, closes symfony#6689) [Profiler] [Redis] Fix sort of profiler rows. Fix version_compare() calls for PHP 5.5. Removed underscores from test method names to be consistent with other components. [Process] In edge cases `getcwd()` can return `false`, then `proc_open()` should get `null` to use default value (the working dir of the current PHP process) Fix version_compare() calls for PHP 5.5. Handle the deprecation of IntlDateFormatter::setTimeZoneId() in PHP 5.5. removed the .gitattributes files (closes symfony#6605, reverts symfony#5674) [HttpKernel] Clarify misleading comment in ExceptionListener Conflicts: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_style.html.twig src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php src/Symfony/Component/Form/Tests/Util/PropertyPathTest.php src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php src/Symfony/Component/Process/Process.php
I think that it is not worth removing the tests classes from archives via the .gitattributes file. The more I think about it, the more I think that the benefits are really small and the drawbacks quite huge:
I would like to revert this change. Opinions?
The text was updated successfully, but these errors were encountered: