hayd / pep8radius

PEP8 clean only the parts of the files touched since the last commit, a previous commit or (the merge-base of) a branch.
MIT License
183 stars 9 forks source link

Current Build Windows Errors, Part II #64

Closed schodge closed 10 years ago

schodge commented 10 years ago

The last thread is long enough, and I propose dedicating it to the problem with Hg errors not propogating up far enough to see easily.

With a username set in Hg, here's the current status:

c:\github\pep8radius (master)
λ nosetests --verbose
test_bad_rev (test_pep8radius.TestRadiusBzr) ... ERROR
test_earlier_revision (test_pep8radius.TestRadiusBzr) ... SKIP
test_one_line (test_pep8radius.TestRadiusBzr) ... SKIP: bzr not available
test_one_line_from_subdirectory (test_pep8radius.TestRadiusBzr) ... SKIP: bzr not available
test_with_docformatter (test_pep8radius.TestRadiusBzr) ... SKIP: bzr not available
test_bad_rev (test_pep8radius.TestRadiusGit) ... ok
test_earlier_revision (test_pep8radius.TestRadiusGit) ... ERROR
test_one_line (test_pep8radius.TestRadiusGit) ... ok
test_one_line_from_subdirectory (test_pep8radius.TestRadiusGit) ... ok
test_with_docformatter (test_pep8radius.TestRadiusGit) ... ok
test_bad_rev (test_pep8radius.TestRadiusHg) ... ok
test_earlier_revision (test_pep8radius.TestRadiusHg) ... ok
test_one_line (test_pep8radius.TestRadiusHg) ... ok
test_one_line_from_subdirectory (test_pep8radius.TestRadiusHg) ... ok
test_with_docformatter (test_pep8radius.TestRadiusHg) ... ok
test_autopep8_args (test_pep8radius.TestRadiusNoVCS) ... ok
test_bad_vc (test_pep8radius.TestRadiusNoVCS) ... ok
test_list_fixes (test_pep8radius.TestRadiusNoVCS) ... ok
test_no_vc (test_pep8radius.TestRadiusNoVCS) ... ok
test_unknown_vc (test_pep8radius.TestRadiusNoVCS) ... ok
test_using_vc (test_pep8radius.TestRadiusNoVCS) ... ok
test_version_number (test_pep8radius.TestRadiusNoVCS) ... ok

======================================================================
ERROR: test_bad_rev (test_pep8radius.TestRadiusBzr)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\github\pep8radius\tests\test_pep8radius.py", line 278, in test_bad_rev
    'random_junk_sha')
  File "C:\Anaconda\lib\unittest\case.py", line 473, in assertRaises
    callableObj(*args, **kwargs)
  File "c:\github\pep8radius\tests\test_pep8radius.py", line 277, in <lambda>
    lambda x: Radius.new(rev=x, vc=self.vc),
  File "c:\github\pep8radius\pep8radius.py", line 256, in new
    return r(rev=rev, options=options)
  File "c:\github\pep8radius\pep8radius.py", line 223, in __init__
    self.rev = self._branch_point(rev)
  File "c:\github\pep8radius\pep8radius.py", line 408, in _branch_point
    current = self.current_branch()
  File "c:\github\pep8radius\pep8radius.py", line 542, in current_branch
    "--custom", "--template={revision_id}"])
  File "c:\github\pep8radius\pep8radius.py", line 55, in shell_out
    out = subprocess.check_output(cmd, stderr=stderr, universal_newlines=True)
  File "C:\Anaconda\lib\subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "C:\Anaconda\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Anaconda\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

======================================================================
ERROR: test_earlier_revision (test_pep8radius.TestRadiusGit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\github\pep8radius\tests\test_pep8radius.py", line 286, in test_earlier_revision
    self.checkout('ter', create=True)
  File "c:\github\pep8radius\tests\test_pep8radius.py", line 340, in checkout
    shell_out(["git", "checkout", '-b', branch])
  File "c:\github\pep8radius\pep8radius.py", line 55, in shell_out
    out = subprocess.check_output(cmd, stderr=stderr, universal_newlines=True)
  File "C:\Anaconda\lib\subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
CalledProcessError: Command '['git', 'checkout', '-b', 'ter']' returned non-zero exit status 128

----------------------------------------------------------------------
Ran 22 tests in 15.859s

FAILED (SKIP=4, errors=2)
hayd commented 10 years ago

sorry I'd missed this.

Is the test_earlier_revision because the ter branch already exists? (what is the output?) Do you know which shell command this is tripping up on the bad rev (cmd)?

schodge commented 10 years ago

Yes, it's the files not removing. I believe it's just some weird permissions thing that can happen on Windows depending on how an account is configured - sometimes you seem to lose the ability to remove files you created or something. Can't remember exactly, but the patch I submitted should work around that and forcibly remove the files.

hayd commented 10 years ago

Weirdly, I couldn't repo this/have fixed these.

There's still the hg test failing (which seems to be that hg automatically adds all files which are untracked on unix).

schodge commented 10 years ago

The problem seems likely only to manifest if you're on a corporate machine with lots of tiered permissions. Somehow I was creating file I couldn't remove by default.

hayd commented 10 years ago

Was that the one you fixed - permissions thing?

I'm did a little refactor (fun) which reproduced the ter branch thing on mac/linux, suspect I can fix it.