Merge lp:~james-w/pkgme-service/drop-name-check into lp:pkgme-service

Proposed by James Westby
Status: Merged
Approved by: James Westby
Approved revision: 221
Merged at revision: 219
Proposed branch: lp:~james-w/pkgme-service/drop-name-check
Merge into: lp:pkgme-service
Diff against target: 89 lines (+2/-48)
2 files modified
src/djpkgme/tasks.py (+0/-17)
src/djpkgme/tests/test_tasks.py (+2/-31)
To merge this branch: bzr merge lp:~james-w/pkgme-service/drop-name-check
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Review via email: mp+256389@code.launchpad.net

Commit message

Drop the check that the package name matches myapps.

It's not longer possible for the developer to specify the
package name outside the package, so the check would never
fail.

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks good!

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (18.0 KiB)

The attempt to merge lp:~james-w/pkgme-service/drop-name-check into lp:pkgme-service failed. Below is the output from the failed tests.

python django_project/manage.py test djpkgme
Creating test database for alias 'default'...
Destroying test database for alias 'default'...
Running pkgme-service tests in tarmac
[ -d ../download-cache ] && (cd ../download-cache && bzr pull) || (bzr branch lp:~ubuntuone-pqm-team/pkgme-service/download-cache ../download-cache)
Using saved parent location: bzr+ssh://bazaar.launchpad.net/~ubuntuone-pqm-team/pkgme-service/download-cache/
No revisions or tags to pull.
Pulling config-manager
bzr branch lp:~ubuntuone-pqm-team/config-manager/stable branches/config-manager
[ -d ../download-cache ] && (cd ../download-cache && bzr pull) || (bzr branch lp:~ubuntuone-pqm-team/pkgme-service/download-cache ../download-cache)
Using saved parent location: bzr+ssh://bazaar.launchpad.net/~ubuntuone-pqm-team/pkgme-service/download-cache/
No revisions or tags to pull.
make install-wheels
make[1]: Entering directory `/mnt/tarmac/cache/pkgme-service/trunk'
pip install --find-links=file://`pwd`/../download-cache/dist --no-index --no-deps -U pip
Ignoring indexes: https://pypi.python.org/simple/
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
Cleaning up...
pip install --find-links=../download-cache/wheels --no-index --no-deps -U setuptools
Ignoring indexes: https://pypi.python.org/simple/
Unpacking /mnt/tarmac/cache/pkgme-service/download-cache/wheels/setuptools-3.4.4-py2.py3-none-any.whl
Installing collected packages: setuptools
  Found existing installation: setuptools 2.2
    Uninstalling setuptools:
      Successfully uninstalled setuptools
Successfully installed setuptools
Cleaning up...
pip install --find-links=../download-cache/wheels --no-index --no-deps --egg twisted txstatsd treeshape
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking twisted
Downloading/unpacking txstatsd
Downloading/unpacking treeshape
Installing collected packages: twisted, txstatsd, treeshape
Successfully installed twisted txstatsd treeshape
Cleaning up...
pip install --find-links=../download-cache/wheels --no-index --no-deps -r requirements/dev.txt
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking amqplib==1.0.2 (from -r requirements/prod.txt (line 1))
Downloading/unpacking anyjson==0.3.3 (from -r requirements/prod.txt (line 2))
Downloading/unpacking bson==0.3.3 (from -r requirements/prod.txt (line 3))
Downloading/unpacking bzr==2.5.1 (from -r requirements/prod.txt (line 4))
Downloading/unpacking celery==2.5.0 (from -r requirements/prod.txt (line 5))
Downloading/unpacking Cheetah==2.4.4 (from -r requirements/prod.txt (line 6))
Downloading/unpacking configglue==1.0.1 (from -r requirements/prod.txt (line 7))
Downloading/unpacking django==1.4.14 (from -r requirements/prod.txt (line 8))
Downloading/unpacking django-celery==2.5.0 (from -r requirements/prod.txt (line 9))
Downloading/unpacking django-configglue==0.7.1 (from -r requirements/prod.txt (line 10))
Downloading/unpacking django-openid-auth==0.4 (from -r requirements/prod.txt (line 11))
Downloading/unpacking django-picklefield==0.2.1 ...

221. By James Westby

Fix the integration test.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/djpkgme/tasks.py'
2--- src/djpkgme/tasks.py 2015-03-18 21:05:49 +0000
3+++ src/djpkgme/tasks.py 2015-04-15 19:54:41 +0000
4@@ -489,7 +489,6 @@
5 results = []
6 if not (unpack_result['error'] or unpack_result['warn']):
7 results.extend([
8- self.check_package_name_matches(metadata, unpacked),
9 self.check_package_version_matches(metadata, unpacked),
10 ])
11 return results
12@@ -500,22 +499,6 @@
13
14 return results
15
16- def check_package_name_matches(self, metadata, package):
17- status = text = None
18-
19- manifest = self.get_package_manifest(package)
20- if manifest['name'] != metadata['package_fullname']:
21- status = 'error'
22- text = '''Package name in the manifest: `{}`
23-
24-Package name in My Apps: `{}`
25-'''.format(manifest['name'], metadata['package_fullname'])
26-
27- check_result = make_check_result(
28- 'Stated package name matches the manifest',
29- status=status, text=text)
30- return check_result
31-
32 def check_package_version_matches(self, metadata, package):
33 status = text = None
34
35
36=== modified file 'src/djpkgme/tests/test_tasks.py'
37--- src/djpkgme/tests/test_tasks.py 2015-03-18 21:05:49 +0000
38+++ src/djpkgme/tests/test_tasks.py 2015-04-15 19:54:41 +0000
39@@ -1177,34 +1177,6 @@
40 p.start()
41 self.addCleanup(p.stop)
42
43- def test_check_package_name_matches(self):
44- job = ClickPackageReviewJob()
45- package_name = 'some.package'
46- metadata = dict(package_fullname=package_name)
47- tempdir = self.useFixture(TempDir()).path
48- self.make_manifest_file(dict(name=package_name), tempdir)
49- result = job.check_package_name_matches(metadata, tempdir)
50- expected_result = make_check_result(
51- 'Stated package name matches the manifest')
52- self.assertEqual(result, expected_result)
53-
54- def test_check_package_name_doesnt_match(self):
55- job = ClickPackageReviewJob()
56- package_name = 'some.package'
57- other_package_name = 'some.other.package'
58- metadata = dict(package_fullname=package_name)
59- tempdir = self.useFixture(TempDir()).path
60- self.make_manifest_file(dict(name=other_package_name), tempdir)
61- result = job.check_package_name_matches(metadata, tempdir)
62- explanation = '''Package name in the manifest: `{}`
63-
64-Package name in My Apps: `{}`
65-'''.format(other_package_name, package_name)
66- expected_result = make_check_result(
67- 'Stated package name matches the manifest',
68- status='error', text=explanation)
69- self.assertEqual(result, expected_result)
70-
71 def test_check_package_version_matches(self):
72 job = ClickPackageReviewJob()
73 version = '1.0'
74@@ -1447,13 +1419,12 @@
75 cmd = [script_path, downloaded_path, '{"framework": {}}']
76 mock_call.assert_any_call(cmd, stderr=subprocess.STDOUT)
77 self.assertEqual(3, len(results.keys()))
78- # there should be 5 successful checks:
79+ # there should be 4 successful checks:
80 # - valid click package
81- # - package name matches manifest
82 # - package version matches manifest
83 # - 1 click reviewers tools script (faked in test)
84 # - check click-reviewers-tools revno
85- self.assertEqual(5, len(results['info']))
86+ self.assertEqual(4, len(results['info']))
87 # there should be no errors
88 self.assertEqual(0, len(results['warn']))
89 self.assertEqual(0, len(results['error']))

Subscribers

People subscribed via source and target branches