diff options
author | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-07-05 14:16:34 +0100 |
---|---|---|
committer | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2018-07-05 14:16:34 +0100 |
commit | 5d1009b0af1d30584708ffdd5192408106ae6ede (patch) | |
tree | 0e696df1c097c82accb42e20c71610b1e37444ab /tests/loader/junctions.py | |
parent | 8c82f22f2bdbcbb623d24d80d2e72070e03e2080 (diff) | |
parent | af993bbb5319cc0568695b9f3ea26b738ef6f76f (diff) | |
download | buildstream-jmac/googlecas_and_virtual_directories_3.tar.gz |
Merge branch 'jmac/virtual_directories' into jmac/googlecas_and_virtual_directories_3jmac/googlecas_and_virtual_directories_3
Diffstat (limited to 'tests/loader/junctions.py')
-rw-r--r-- | tests/loader/junctions.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/loader/junctions.py b/tests/loader/junctions.py index 635a987bd..a02961fb5 100644 --- a/tests/loader/junctions.py +++ b/tests/loader/junctions.py @@ -260,3 +260,43 @@ def test_git_build(cli, tmpdir, datafiles): # Check that the checkout contains the expected files from both projects assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) assert(os.path.exists(os.path.join(checkoutdir, 'foo.txt'))) + + +@pytest.mark.datafiles(DATA_DIR) +def test_cross_junction_names(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'foo') + copy_subprojects(project, datafiles, ['base']) + + element_list = cli.get_pipeline(project, ['base.bst:target.bst']) + assert 'base.bst:target.bst' in element_list + + +@pytest.mark.datafiles(DATA_DIR) +def test_build_git_cross_junction_names(cli, tmpdir, datafiles): + project = os.path.join(str(datafiles), 'foo') + checkoutdir = os.path.join(str(tmpdir), "checkout") + + # Create the repo from 'base' subdir + repo = create_repo('git', str(tmpdir)) + ref = repo.create(os.path.join(str(datafiles), 'base')) + + # Write out junction element with git source + element = { + 'kind': 'junction', + 'sources': [ + repo.source_config(ref=ref) + ] + } + _yaml.dump(element, os.path.join(project, 'base.bst')) + + print(element) + print(cli.get_pipeline(project, ['base.bst'])) + + # Build (with implicit fetch of subproject), checkout + result = cli.run(project=project, args=['build', 'base.bst:target.bst']) + assert result.exit_code == 0 + result = cli.run(project=project, args=['checkout', 'base.bst:target.bst', checkoutdir]) + assert result.exit_code == 0 + + # Check that the checkout contains the expected files from both projects + assert(os.path.exists(os.path.join(checkoutdir, 'base.txt'))) |