ciena-blueplanet / git-fat

Manage large binary files with git
BSD 2-Clause "Simplified" License
97 stars 20 forks source link

Unit tests say it is "OK", but there were errors #30

Closed cztomczak closed 9 years ago

cztomczak commented 9 years ago
py27 runtests: commands[2] | python -m unittest discover
.....Updating git-fat files
ERROR:git_fat.py:No section found in /tmp/git-fat-testQxGFia/fat-test1/.gitfat for backend http
.....
----------------------------------------------------------------------
Ran 10 tests in 21.586s

OK

git-fat raises RuntimeError() in the _get_options() function.

Using latest master on Ubuntu 12.04 64-bit.

abraithwaite commented 9 years ago

Hmm. I'm not seeing the same. Would it be possible to isolate the test which is causing it?

pip install -r tests/test_requirements.txt
python -m unittest tests.test_git_fat.{TestCase}.{test_function}

I'm unsure of a way to print the name of each test as it's executed though. :frowning:

cztomczak commented 9 years ago

It is GeneralTestCase.test_status:

czarek@czarek-T420:~/cyan/ctomczak.git-fat$ python -m unittest tests.test_git_fat.GeneralTestCase.test_status
Updating git-fat files
ERROR:git_fat.py:No section found in /tmp/git-fat-testDg7ckL/fat-test1/.gitfat for backend http
.
----------------------------------------------------------------------
Ran 1 test in 4.282s

OK
cztomczak commented 9 years ago

It seems the issue is when git config --global init.templatedir is set. After unsetting this option error does not occur enymore. See:

czarek@czarek-T420:~/cyan/ctomczak.git-fat$ git config --global init.templatedir
/home/czarek/.git_template
czarek@czarek-T420:~/cyan/ctomczak.git-fat$ git config --global init.templatedir ""
czarek@czarek-T420:~/cyan/ctomczak.git-fat$ git config --global init.templatedir

czarek@czarek-T420:~/cyan/ctomczak.git-fat$ python -m unittest tests.test_git_fat.GeneralTestCase.test_status
.
----------------------------------------------------------------------
Ran 1 test in 2.837s

OK

Btw. I am working on Windows support, we need it at Cyan. I've already made a lot of progress, but there are still several issues. If I succeed you should see a pull request in a few days.

On Windows I've also had an issue with init.templatedir option. I've resolved it by running tests manually so that main() is run, and in that main I've added calls like unset_templatedir() and restore_templatedir() that are executed before and after running the tests.

abraithwaite commented 9 years ago

Ah this makes sense. I don't generally work with the templatedir set. Your solution sounds good to me.

cztomczak commented 9 years ago

This was fixed in pull request #31.