Skip to content

[2.1] Exclude tests from zips via gitattributes #5674

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

Merged
merged 1 commit into from
Oct 4, 2012

Conversation

igorw
Copy link
Contributor

@igorw igorw commented Oct 4, 2012

fabpot added a commit that referenced this pull request Oct 4, 2012
This PR was merged into the 2.1 branch.

Commits
-------

462dddf [2.1] Exclude tests from zips via gitattributes

Discussion
----------

[2.1] Exclude tests from zips via gitattributes

See also: [Composer - Light-weight distribution packages](http://getcomposer.org/doc/02-libraries.md#light-weight-distribution-packages).
@fabpot fabpot merged commit 462dddf into symfony:2.1 Oct 4, 2012
@pborreli
Copy link
Contributor

pborreli commented Oct 4, 2012

why not ignore .travis.yml at symfony root as you recommend in your link ?

@igorw
Copy link
Contributor Author

igorw commented Oct 4, 2012

It's not really worth it for the main package. If we exclude anything, we should also exclude the tests. And AFAIK we would have to list all of the full paths for that which is a maintenance nightmare.

The symfony/symfony package should usually not get installed anyway.

@pborreli
Copy link
Contributor

pborreli commented Oct 4, 2012

ok thanks

@stof
Copy link
Member

stof commented Oct 4, 2012

@igorw This is not working for me. I have to put Tests/* (which keeps an empty Tests folder but is better than keeping the content).

and .gitattributes is used recursively, just like .gitignore. So once you fix them, tests will be ignored for the main package too :)

@igorw
Copy link
Contributor Author

igorw commented Oct 9, 2012

The thing is, this worked for me locally with git archive. So GitHub is doning some strange things. :-/

@igorw
Copy link
Contributor Author

igorw commented Oct 9, 2012

I have contacted GitHub to see if they can make it consistent.

@stof
Copy link
Member

stof commented Oct 9, 2012

@igorw What is your git version ? I was not talking about Github but about my local testing

@igorw
Copy link
Contributor Author

igorw commented Oct 9, 2012

Ah, maybe that's new then.

$ git --version
git version 1.7.12.2

@stof
Copy link
Member

stof commented Oct 9, 2012

I'm using 1.7.11

@igorw
Copy link
Contributor Author

igorw commented Dec 3, 2012

For the record, GitHub have updated their git version and it is now working as intended.

@marijn
Copy link

marijn commented Jan 7, 2013

I think this is a mistake. This way I have to install with --prefer-source just to run the tests. The bandwith this saves is really not worth it in my opinion now that composer also caches tagged repositories.

@clemherreman
Copy link
Contributor

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 puttin my application on production, just to ensure that my server environnement doesn't break them.

@fabpot
Copy link
Member

fabpot commented Jan 9, 2013

reverted

fabpot added a commit that referenced this pull request Jan 17, 2013
* 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
@jdufresne
Copy link
Contributor

@fabpot

I was directed here from fabpot/Twig#2

From @marijn

I think this is a mistake. This way I have to install with --prefer-source just to run the tests. The bandwith this saves is really not worth it in my opinion now that composer also caches tagged repositories.

From @clemherreman

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 puttin my application on production, just to ensure that my server environnement doesn't break them.

If your goal is running tests (developing Symfonty/Twig), a git clone be more appropriate. Which will continue to provide all the files.

If your goal is reading documentation, the online documentation makes more sense than reading the raw documentation. http://twig.sensiolabs.org/documentation If the documentation is insufficient, well that seems like a different bug/issue.


FWIW, I use Twig as a library (without Symfony) and downloading/deploying these extra bits across multiple servers is costing me bandwidth and time. Especially when you consider Twig is just one of many third party libraries I use. I'd prefer to download just the code when installing through compser. Deploying the documentation makes no sense. Deploying the tests make no sense. If I want to read documentation and tests, there are still plenty of avenues to do just that.

@Tobion
Copy link
Contributor

Tobion commented Oct 23, 2014

@jdufresne see #6605 for more arguments.

@rdohms
Copy link
Contributor

rdohms commented Dec 10, 2014

So --prefer-dist is mostly geared towards production environments, where i'm guessing you do not want tests, or even to run them.

Developer environments should indeed use --prefer-source, especially if they want to run tests or submit patches.

I do not think its nice to force everyone to download overhead data just so some people can run tests without using --prefer-source, The solution for those people is already there, but the solution for people who want sleek installs with little overhead does not exist.

Because of this, the .gitattributes is a good idea.

@afurculita
Copy link
Contributor

+1 to @rdohms comment

nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull request Mar 3, 2016
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants