diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-05-03 15:14:38 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-05-08 03:59:38 +0900 |
commit | 5bdc0a79d1fb67d2da552a902163dec450ff292c (patch) | |
tree | ee63ed73e90dbc9aba1d08971e54016bb7839708 /tests/plugins/pipeline.py | |
parent | b8e15706a51272e4f4e116d9e373fd2581102868 (diff) | |
download | buildstream-5bdc0a79d1fb67d2da552a902163dec450ff292c.tar.gz |
_stream.py, _pipeline.py: Refactoring of the pipeline itself
Here the pipeline becomes essentially stateless, some dangling
state remains to be factored out because of frontend accesses
which will be changed in a later commit.
Essentially, the Pipeline.load() method no longer has any knowledge
of the specific purposes of the loaded targets, and now takes
a list of target groups and returns a corresponding list of element
groups.
The Stream() business logic methods now use other pipeline helper
methods to create and filter lists from the loaded target elements.
The Stream() also finally absorbs the Scheduler frontend facing
APIs. However Queues are still exposed on the Stream object for
logging purposes and through callbacks such that the frontend can
retry elements.
Diffstat (limited to 'tests/plugins/pipeline.py')
-rw-r--r-- | tests/plugins/pipeline.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/plugins/pipeline.py b/tests/plugins/pipeline.py index db683094b..65929cf50 100644 --- a/tests/plugins/pipeline.py +++ b/tests/plugins/pipeline.py @@ -23,23 +23,25 @@ def create_pipeline(tmpdir, basedir, target): context.set_message_handler(dummy_handler) - return Pipeline(context, project, None, [target], []) + pipeline = Pipeline(context, project, None) + targets, = pipeline.load([(target,)]) + return targets @pytest.mark.datafiles(os.path.join(DATA_DIR, 'customsource')) def test_customsource(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'simple.bst') - assert(pipeline.targets[0].get_kind() == "autotools") + targets = create_pipeline(tmpdir, basedir, 'simple.bst') + assert(targets[0].get_kind() == "autotools") @pytest.mark.datafiles(os.path.join(DATA_DIR, 'customelement')) def test_customelement(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) - pipeline = create_pipeline(tmpdir, basedir, 'simple.bst') - assert(pipeline.targets[0].get_kind() == "foo") + targets = create_pipeline(tmpdir, basedir, 'simple.bst') + assert(targets[0].get_kind() == "foo") @pytest.mark.datafiles(os.path.join(DATA_DIR, 'badversionsource')) @@ -47,7 +49,7 @@ def test_badversionsource(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) with pytest.raises(LoadError) as exc: - pipeline = create_pipeline(tmpdir, basedir, 'simple.bst') + targets = create_pipeline(tmpdir, basedir, 'simple.bst') assert exc.value.reason == LoadErrorReason.UNSUPPORTED_PLUGIN @@ -57,6 +59,6 @@ def test_badversionelement(datafiles, tmpdir): basedir = os.path.join(datafiles.dirname, datafiles.basename) with pytest.raises(LoadError) as exc: - pipeline = create_pipeline(tmpdir, basedir, 'simple.bst') + targets = create_pipeline(tmpdir, basedir, 'simple.bst') assert exc.value.reason == LoadErrorReason.UNSUPPORTED_PLUGIN |