Skip to content
Snippets Groups Projects

Use virtual artifact directory to stage and extract metadata

Merged Jürg Billeter requested to merge juerg/virtual-artifact-directory into master
1 file
+ 1
10
Compare changes
  • Side-by-side
  • Inline
@@ -22,7 +22,6 @@ DATA_DIR = os.path.join(
# cleared as just forcefully removing the refpath leaves dangling objects.
def default_state(cli, tmpdir, share):
shutil.rmtree(os.path.join(str(tmpdir), 'cas'))
shutil.rmtree(os.path.join(str(tmpdir), 'extract'))
cli.configure({
'artifacts': {'url': share.repo, 'push': False},
'cachedir': str(tmpdir),
@@ -70,17 +69,11 @@ def test_pullbuildtrees(cli2, tmpdir, datafiles):
# Pull artifact with default config, then assert that pulling
# with buildtrees cli flag set creates a pull job.
# Also assert that the buildtree is added to the artifact's
# extract dir
result = cli2.run(project=project, args=['artifact', 'pull', element_name])
assert element_name in result.get_pulled_elements()
elementdigest = share1.has_artifact('test', element_name, cli2.get_element_key(project, element_name))
buildtreedir = os.path.join(str(tmpdir), 'extract', 'test', 'autotools-amhello',
elementdigest.hash, 'buildtree')
assert not os.path.isdir(buildtreedir)
assert share1.has_artifact('test', element_name, cli2.get_element_key(project, element_name))
result = cli2.run(project=project, args=['--pull-buildtrees', 'artifact', 'pull', element_name])
assert element_name in result.get_pulled_elements()
assert os.path.isdir(buildtreedir)
default_state(cli2, tmpdir, share1)
# Pull artifact with pullbuildtrees set in user config, then assert
@@ -138,7 +131,6 @@ def test_pullbuildtrees(cli2, tmpdir, datafiles):
result = cli2.run(project=project, args=['--pull-buildtrees', 'artifact', 'push', element_name])
assert "Attempting to fetch missing artifact buildtrees" in result.stderr
assert element_name not in result.get_pulled_elements()
assert not os.path.isdir(buildtreedir)
assert element_name not in result.get_pushed_elements()
assert not share3.has_artifact('test', element_name, cli2.get_element_key(project, element_name))
@@ -150,7 +142,6 @@ def test_pullbuildtrees(cli2, tmpdir, datafiles):
result = cli2.run(project=project, args=['--pull-buildtrees', 'artifact', 'push', element_name])
assert "Attempting to fetch missing artifact buildtrees" in result.stderr
assert element_name in result.get_pulled_elements()
assert os.path.isdir(buildtreedir)
assert element_name in result.get_pushed_elements()
assert share3.has_artifact('test', element_name, cli2.get_element_key(project, element_name))
Loading