Skip to content
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

Windows tests fail #655

Closed
techtonik opened this issue Oct 8, 2016 · 16 comments
Closed

Windows tests fail #655

techtonik opened this issue Oct 8, 2016 · 16 comments

Comments

@techtonik
Copy link
Contributor

https://ci.appveyor.com/project/jdavid/pygit2/branch/master/job/pe30m4i7qwl2br64

Windows has a strict requirements that all files need to be closed when removing dir. https://superuser.com/questions/2937/how-do-i-delete-a-folder-thats-in-use

======================================================================
ERROR: test_write_commit (test.test_archive.ArchiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python35\lib\shutil.py", line 381, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp0up7s6rm\\testrepo\\.git\\objects\\pack\\pack-e6fbc15b315a0eab6005c44e5b7054b1f0043f39.idx'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\projects\pygit2\test\utils.py", line 135, in tearDown
    self.repo_ctxtmgr.__exit__(None, None, None)
  File "C:\projects\pygit2\test\utils.py", line 86, in __exit__
    rmtree(self.temp_dir)
  File "C:\projects\pygit2\test\utils.py", line 65, in rmtree
    shutil.rmtree(path, onerror=onerror)
  File "C:\Python35\lib\shutil.py", line 488, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python35\lib\shutil.py", line 383, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\projects\pygit2\test\utils.py", line 64, in <lambda>
    onerror = lambda func, path, e: force_rm_handle(func, path, e)
  File "C:\projects\pygit2\test\utils.py", line 47, in force_rm_handle
    remove_path(path)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp0up7s6rm\\testrepo\\.git\\objects\\pack\\pack-e6fbc15b315a0eab6005c44e5b7054b1f0043f39.idx'
@techtonik
Copy link
Contributor Author

First guess is that index = Index() resource needs to be freed.

@jdavid
Copy link
Member

jdavid commented Oct 9, 2016

@fourplusone
Copy link
Contributor

Indeed, however lots tests are still failing :( It seems mostly related to files not being closed at the end of the test

@techtonik
Copy link
Contributor Author

Even partial fix is good. I can help only one by one.

@jdavid
Copy link
Member

jdavid commented Oct 13, 2016

I have merged branch fourplusone/fix/windows-tests from @fourplusone and errors are down to 7 from 146

But the build is green, it should be red since there are still 7 errors, @fourplusone do you know why it is green now?

@fourplusone
Copy link
Contributor

try { & $env:PYTHON setup.py nosetests --with-xunit } catch {} in appveyor.yaml catches all errors during the test. maybe one should remove the try...catch... statement

@jdavid
Copy link
Member

jdavid commented Oct 14, 2016

Thanks @fourplusone , it's red now. Do you know how to trigger a build automatically on every push to master?

@fourplusone
Copy link
Contributor

This should be done automatically

From https://www.appveyor.com/docs/:

For every project AppVeyor will configure webhooks for its repository to automatically start a build when you push the changes. For every private project AppVeyor will add an SSH public key (deployment key) to the clone repository on the build machine.

@techtonik
Copy link
Contributor Author

It makes sense to enable AppVeyor test for pull requests too http://help.appveyor.com/discussions/questions/203-auto-run-tests-on-pull-requests

@jdavid
Copy link
Member

jdavid commented Oct 18, 2016

http://help.appveyor.com/discussions/questions/203-auto-run-tests-on-pull-requests#comment_33212404

This requires access to the pygit2's settings page at github, which I don't have. So this will have to be handled by someone else, @carlosmn can you do this? Or may be give me the rights to manage pygit2's settings.

@techtonik
Copy link
Contributor Author

@carlosmn
Copy link
Member

@jdavid I've given you admin access to pygit2 so you should be able to set it all up yourself. Let me know if you run into problems.

@jdavid
Copy link
Member

jdavid commented Oct 18, 2016

Webhook added.

By the way there was already a broken webhook to tenxer.com, @carlosmn do you know what is it? Can I safely remove it?

@carlosmn
Copy link
Member

It looks like it used to be a stats tracking thing, but Twitter bought and shut it down, so let's just remove it.

@jdavid
Copy link
Member

jdavid commented Oct 18, 2016

thanks, removed

@techtonik
Copy link
Contributor Author

Fixed by #661. Thanks @fourplusone.

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

No branches or pull requests

4 participants