diff options
author | Phil Dawson <phil.dawson@codethink.co.uk> | 2019-03-07 14:44:00 +0000 |
---|---|---|
committer | Phil Dawson <phil.dawson@codethink.co.uk> | 2019-03-14 10:13:44 +0000 |
commit | 2daf893b302b3155f44517248a3cfe7063376a60 (patch) | |
tree | ba145743b88346c6e64d7850d8997adaa062f868 /tests/frontend/buildcheckout.py | |
parent | 37786a65cf99aafb410a616764e1425e31837eca (diff) | |
download | buildstream-2daf893b302b3155f44517248a3cfe7063376a60.tar.gz |
tests: move templated tests from buildcheckout.py into basic_functionality.py
Move the templated tests in tests/frontend/buildcheckout.py into
sources/generic/buildcheckout.py
This is part of the preparation work for #944
Diffstat (limited to 'tests/frontend/buildcheckout.py')
-rw-r--r-- | tests/frontend/buildcheckout.py | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/tests/frontend/buildcheckout.py b/tests/frontend/buildcheckout.py index 808f7e128..a2283c94b 100644 --- a/tests/frontend/buildcheckout.py +++ b/tests/frontend/buildcheckout.py @@ -4,7 +4,7 @@ import hashlib import pytest import subprocess from tests.testutils.site import IS_WINDOWS -from tests.testutils import create_repo, ALL_REPO_KINDS, generate_junction +from tests.testutils import create_repo, generate_junction from buildstream.plugintestutils import cli from buildstream import _yaml @@ -405,53 +405,6 @@ def test_build_checkout_force_tarball(datafiles, cli): assert os.path.join('.', 'usr', 'include', 'pony.h') in tar.getnames() -fetch_build_checkout_combos = \ - [("strict", kind) for kind in ALL_REPO_KINDS] + \ - [("non-strict", kind) for kind in ALL_REPO_KINDS] - - -@pytest.mark.datafiles(DATA_DIR) -@pytest.mark.parametrize("strict,kind", fetch_build_checkout_combos) -def test_fetch_build_checkout(cli, tmpdir, datafiles, strict, kind): - checkout = os.path.join(cli.directory, 'checkout') - project = os.path.join(datafiles.dirname, datafiles.basename) - dev_files_path = os.path.join(project, 'files', 'dev-files') - element_path = os.path.join(project, 'elements') - element_name = 'build-test-{}.bst'.format(kind) - - # Create our repo object of the given source type with - # the dev files, and then collect the initial ref. - # - repo = create_repo(kind, str(tmpdir)) - ref = repo.create(dev_files_path) - - # Write out our test target - element = { - 'kind': 'import', - 'sources': [ - repo.source_config(ref=ref) - ] - } - _yaml.dump(element, - os.path.join(element_path, - element_name)) - - assert cli.get_element_state(project, element_name) == 'fetch needed' - result = cli.run(project=project, args=strict_args(['build', element_name], strict)) - result.assert_success() - assert cli.get_element_state(project, element_name) == 'cached' - - # Now check it out - result = cli.run(project=project, args=strict_args([ - 'artifact', 'checkout', element_name, '--directory', checkout - ], strict)) - result.assert_success() - - # Check that the pony.h include from files/dev-files exists - filename = os.path.join(checkout, 'usr', 'include', 'pony.h') - assert os.path.exists(filename) - - @pytest.mark.datafiles(DATA_DIR) def test_install_to_build(cli, datafiles): project = os.path.join(datafiles.dirname, datafiles.basename) |