diff options
author | Raoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk> | 2019-05-02 16:01:13 +0100 |
---|---|---|
committer | Raoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk> | 2019-05-10 16:09:20 +0100 |
commit | 7299f85e98b558edac216af5cd8c1ca2762041bd (patch) | |
tree | a8ceabaf9e3ee919bd9586b3af451f98298c8c45 /tests/sources/previous_source_access.py | |
parent | cc871d37500cc78d16112cf31bf32685c3b7e9aa (diff) | |
download | buildstream-7299f85e98b558edac216af5cd8c1ca2762041bd.tar.gz |
source.py: ensure previous track refs are updatedraoul/1010-multiple-track-fix
Updates the refs in the job process (but doesn't write), to ensure
following sources can see consistency of previous sourcse has been
updated. `_save_ref` is renamed `_set_ref` with writing to file now
optional.
This also changes the previous_source_access test to use a remote, so
that it actually tests this cornercase.
Fixes #1010
Diffstat (limited to 'tests/sources/previous_source_access.py')
-rw-r--r-- | tests/sources/previous_source_access.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/sources/previous_source_access.py b/tests/sources/previous_source_access.py index a0661ca98..800e0ced5 100644 --- a/tests/sources/previous_source_access.py +++ b/tests/sources/previous_source_access.py @@ -4,6 +4,7 @@ import os import pytest +from buildstream import _yaml from buildstream.testing import cli # pylint: disable=unused-import DATA_DIR = os.path.join( @@ -20,6 +21,13 @@ DATA_DIR = os.path.join( def test_custom_transform_source(cli, datafiles): project = str(datafiles) + # Set the project_dir alias in project.conf to the path to the tested project + project_config_path = os.path.join(project, "project.conf") + project_config = _yaml.load(project_config_path) + aliases = _yaml.node_get(project_config, dict, "aliases") + _yaml.node_set(aliases, "project_dir", "file://{}".format(project)) + _yaml.dump(project_config, project_config_path) + # Ensure we can track result = cli.run(project=project, args=[ 'source', 'track', 'target.bst' |