Include test environment in git repo?

I am slowly doing git and testing part of my normal workflow. I would be grateful to include git repo in the project.

On the one hand, it seems that this should not be, because the framework a) is easily accessible elsewhere and b) is not unique to the project (I'm talking about popular frames like qunit for JS or simpletest in PHP). In this case, perhaps a simple reading in the repo indicating the version of the framework and where to get it will suffice.

On the other hand, tests are part of the project (and part of the repo) and need a framework to run, so for completeness, perhaps, a structure should also be included.

Thanks.

+7
source share
8 answers

Reading the answers to this question is interesting, as it shows a very wide range of interpretations of many different aspects of software development. Usually, I believe that no dependencies should be stored in VCS (VCS, I mean tools like git, hg, svn, cvs and no larger systems that include tools like Xcode) because this is not work VCS. Dependency tracking is best left to the packaging tool. (It seems that many people use VCS as a primitive packaging tool, which IMHO is a huge mistake.)

I think you need to clarify what you mean by "test environment." For me, most of my test suites are called by the framework provided by automake. Of course, I do not include automake in my git repository, but in the future there will be no problems with version differences, because the entire test structure generated by automake is included in the tarball distribution. So really the question is pushed to another level. If you use only VCS to track your releases, you have a problem because you really need to have a test framework when you are viewing an old version of a project. If VCS is the only storage mechanism for retrieving old releases (i.e. you do not use any kind of archived releases in archives), then you seem to be forced to put the framework in VCS. But hosting external software on your VCS is, frankly, stupid. The only reason for this is to use VCS as a distribution tool. Therefore, I believe that my answer is this: do not put the framework in your VCS, but put the framework in your distributions. If your VCS is your distribution tool, then there is no proper way to work with the test infrastructure.

+2
source

I almost always turn on the framework (the normal one should have several libraries and executables, therefore not so big) - the source and tests are versioned, and if I ever come back and get version 1.2 of my code from 2001, I want the tests to run, when I make this fix, do not fail, because I use the testing environment with which I changed in 2006.

Without a test environment in version control, I add one more thing that should be versioned. Gosh, I could use the compiler and language libraries where possible.

If you have a giant test tool / platform that cannot be easily pasted side by side (or cannot be legally pasted side by side), make sure you include some kind of document that tells which tool, which version, and maybe how to get it along with tests.

+3
source

Interest Ask. I do not think that the testing framework should be included in the application repository.

What are the background of your project in the readme file. If you have several projects that use the same testing structure, you already have the infrastructure installed and you probably won’t want to download or install it for each project.

+1
source

I include the NUnit DLL in all of my unit test repositories. In fact, I include everything in the repository that I need to compile and run the tests. Of course, this is not possible for some projects, but when it is feasible, it becomes very simple to check the repository and start working. No installation required.

+1
source

We add all library links to our repositories.

This has the advantage that you have all the necessary components in one place. If you have a new computer, you just need to install the IDE of your choice, check the repository, and you're ready.

It also simplifies the promotion of the build process on the build server, since you only need to point it to your repository, which includes everything you need for the build (despite the .NET structure). Therefore, it is easy to build an old version without problem with the version.

+1
source

I would say no, because they are easily accessible elsewhere, and any experienced developer should already have these libraries.

In addition, some modern IDEs (in particular, eclipse) already come with the libraries of modules that you need, so it doesn’t matter sending them with your source.

0
source

No, you should not include an external framework in your repo, unless you change the framework for working with your project.

Depending on which language you use, you can use the README file or rely on your packaging tools; for example, both Python distutils and Perl Module :: Build allow you to specify which external modules are needed to run your tests, and will install dependencies for your users.

0
source

From the world of Python, I would include dependencies in my setup.py . Then the developers can get them.

With tarballs, I sometimes include a generated test file so that people can at least run some sanity tests before starting a project.

0
source

All Articles