From 498e683e1defb3fe919ee14ce26f43868ec1c3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Tue, 29 Sep 2020 11:55:20 +0200 Subject: _stream.py: Pull missing artifacts in push() As per #819, BuildStream should pull missing artifacts by default. The previous behavior was to only pull missing buildtrees. A top-level `--no-pull` option can easily be supported in the future. This change makes it possible to use a single scheduler session (with concurrent pull and push jobs). This commit also simplifies the code as it removes the `sched_error_action` emulation, using the regular frontend code path instead. --- tests/frontend/push.py | 12 ++---------- tests/integration/pullbuildtrees.py | 2 -- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'tests') diff --git a/tests/frontend/push.py b/tests/frontend/push.py index ffcc166f9..4b10b5bcd 100644 --- a/tests/frontend/push.py +++ b/tests/frontend/push.py @@ -239,16 +239,8 @@ def test_push_fails_with_on_error_continue(cli, tmpdir, datafiles): assert_shared(cli, share, project, "target.bst") assert_not_shared(cli, share, project, "import-dev.bst") - errors = [ - "import-dev.bst is not cached", - ( - "Error while pushing. The following elements were not pushed as they are not yet cached:\n" - "\n" - "\timport-dev.bst\n" - ), - ] - for error in errors: - assert error in result.stderr + + assert "Push failed: import-dev.bst is not cached" in result.stderr # Tests that `bst artifact push --deps DEPS` pushes selected dependencies of diff --git a/tests/integration/pullbuildtrees.py b/tests/integration/pullbuildtrees.py index 6d9eefb26..5923ce544 100644 --- a/tests/integration/pullbuildtrees.py +++ b/tests/integration/pullbuildtrees.py @@ -142,7 +142,6 @@ def test_pullbuildtrees(cli2, tmpdir, datafiles): assert element_name in result.get_pulled_elements() cli2.configure({"artifacts": {"url": share3.repo, "push": True}}) 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() with cli2.artifact.extract_buildtree(cwd, cwd, artifact_name) as buildtreedir: assert not buildtreedir @@ -155,7 +154,6 @@ def test_pullbuildtrees(cli2, tmpdir, datafiles): # without exlipictly requiring a bst artifact pull. cli2.configure({"artifacts": [{"url": share1.repo, "push": False}, {"url": share3.repo, "push": True}]}) 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() with cli2.artifact.extract_buildtree(cwd, cwd, artifact_name) as buildtreedir: assert os.path.isdir(buildtreedir) -- cgit v1.2.1