-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Make test_freeze_bazaar_clone not depend on bazaar.launchpad.net #2515
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,41 +218,32 @@ def test_freeze_mercurial_clone(script, tmpdir): | |
_check_output(result, expected) | ||
|
||
|
||
@pytest.mark.network | ||
@pytest.mark.bzr | ||
def test_freeze_bazaar_clone(script, tmpdir): | ||
""" | ||
Test freezing a Bazaar clone. | ||
|
||
""" | ||
|
||
checkout_path = local_checkout( | ||
'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/' | ||
'release-0.1', | ||
tmpdir.join("cache"), | ||
) | ||
# bzr internally stores windows drives as uppercase; we'll match that. | ||
try: | ||
checkout_path = _create_test_package(script, vcs='bazaar') | ||
except OSError as e: | ||
pytest.fail('Invoking `bzr` failed: %s' % e) | ||
checkout_pathC = checkout_path.replace('c:', 'C:') | ||
|
||
result = script.run( | ||
'bzr', 'checkout', '-r', '174', | ||
local_repo( | ||
'bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/' | ||
'release-0.1', | ||
tmpdir.join("cache"), | ||
), | ||
'django-wikiapp', | ||
'bzr', 'checkout', checkout_path, 'bzr-package' | ||
) | ||
result = script.run( | ||
'python', 'setup.py', 'develop', | ||
cwd=script.scratch_path / 'django-wikiapp', | ||
cwd=script.scratch_path / 'bzr-package', | ||
expect_stderr=True, | ||
) | ||
result = script.pip('freeze', expect_stderr=True) | ||
expected = textwrap.dedent("""\ | ||
Script result: ...pip freeze | ||
-- stdout: -------------------- | ||
...-e %s@...#egg=django_wikiapp-... | ||
...""" % checkout_pathC) | ||
...-e bzr+file://%s@1#egg=version_pkg-0.1-... | ||
...""" % checkout_path) | ||
_check_output(result, expected) | ||
|
||
result = script.pip( | ||
|
@@ -264,7 +255,7 @@ def test_freeze_bazaar_clone(script, tmpdir): | |
Script result: ...pip freeze -f %(repo)s/#egg=django-wikiapp | ||
-- stdout: -------------------- | ||
-f %(repo)s/#egg=django-wikiapp | ||
...-e %(repoC)s@...#egg=django_wikiapp-... | ||
...-e bzr+file://%(repoC)s@...#egg=version_pkg-... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue here with file URLs |
||
...""" % {'repoC': checkout_pathC, 'repo': checkout_path}) | ||
_check_output(result, expected) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -505,6 +505,17 @@ def main(): | |
checkout_path = checkout_path.replace('c:', 'C:') | ||
|
||
version_pkg_path = checkout_path | ||
elif vcs == 'bazaar': | ||
script.run('bzr', 'init', cwd=version_pkg_path) | ||
script.run('bzr', 'add', '.', cwd=version_pkg_path) | ||
script.run( | ||
'bzr', 'whoami', 'pip <[email protected]>', | ||
cwd=version_pkg_path) | ||
script.run( | ||
'bzr', 'commit', '-q', | ||
'--author', 'pip <[email protected]>', | ||
'-m', 'initial version', cwd=version_pkg_path, | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One could add an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. Thanks! |
||
else: | ||
raise ValueError('Unknown vcs: %r' % vcs) | ||
return version_pkg_path | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work on Windows? I don't have bzr installed to test, and there are enough other issues with the functional tests on Windows that it's probably not easy to check, but I'd imagine checkout_path has
\
characters. Maybe some form of apath2url
call is needed in here...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd have to fire up a Windows VM and probably install bzr in said VM to test this. Ideally, we can find someone who has both Windows and bzr and enjoys doing Python coding and debugging on Windows. I'm much more comfortable with POSIX myself, so I'd probably fumble my way through the Windows issues.
Oh but then actually you said that there are other issues with running the tests on Windows -- so maybe it's not worth worrying too much about how this test works in Windows until we've fixed the overall problem with running tests on Windows.
Otherwise, I fear we will get stuck on Windows issues and the PR will stagnate and we won't get the benefit of having the Travis CI tests not intermittently fail and confuse people.
I think the tests should work on Windows; I just think it's a bigger task than this PR and so I'm inclined to treat it separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I think this is just another example of a test not written with Windows in mind. Not a problem, just leave it for now and move on IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I raised #2520 as a placeholder issue for getting the tests to work on Windows. Volunteers gratefully accepted of course! :-)