Skip to content

Commit

Permalink
Fix another merge conflict bug (#739)
Browse files Browse the repository at this point in the history
Use the subpackage contents, rather than the whole package, when looking up object hashes.
Make the unittest actually catch that case.
  • Loading branch information
dimaryaz authored Jul 31, 2018
1 parent c4229ec commit 3785792
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions compiler/quilt/test/test_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ def test_push(self):

def test_push_subpackage(self):
mydir = os.path.dirname(__file__)
build_path = os.path.join(mydir, './build_simple.yml')
build_path = os.path.join(mydir, './build.yml')
command.build('foo/bar', build_path)

_, pkgroot = store.PackageStore.find_package(None, 'foo', 'bar')
contents = pkgroot.children['foo']
contents = pkgroot.children['dataframes']

all_hashes = set(find_object_hashes(contents))
upload_urls = {
Expand All @@ -89,10 +89,10 @@ def test_push_subpackage(self):
self.requests_mock.add(responses.HEAD, urls['head'], status=404)
self.requests_mock.add(responses.PUT, urls['put'])

self._mock_update_package('foo/bar', 'foo', contents, upload_urls)
self._mock_update_package('foo/bar', 'dataframes', contents, upload_urls)

# Push a subpackage.
command.push('foo/bar/foo')
command.push('foo/bar/dataframes')

def _mock_put_package(self, package, pkg_hash, contents, upload_urls):
pkg_url = '%s/api/package/%s/%s' % (command.get_registry_url(None), package, pkg_hash)
Expand Down
2 changes: 1 addition & 1 deletion compiler/quilt/tools/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def _push_package(dry_run=False, sizes=dict()):
resp = _push_package(dry_run=True)
obj_urls = resp.json()['upload_urls']

assert set(obj_urls) == set(find_object_hashes(pkgroot))
assert set(obj_urls) == set(find_object_hashes(contents))

obj_sizes = {
obj_hash: os.path.getsize(store.object_path(obj_hash)) for obj_hash in obj_urls
Expand Down

0 comments on commit 3785792

Please sign in to comment.