This is an automated email from the ASF dual-hosted git repository. akitouni pushed a commit to branch abderrahim/drop-test in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit fe3201f784e9985a45b2d59669529d9fc8ee2ad9 Author: Tristan van Berkom <[email protected]> AuthorDate: Sun Feb 11 00:12:42 2024 +0900 _sourcetests/mirror.py: Remove test_mirror_junction_from_includes() This tests an invalid use case, it does not make any sense to be loading mirror definitions across junction boundaries. --- src/buildstream/_testing/_sourcetests/mirror.py | 55 ------------------------- 1 file changed, 55 deletions(-) diff --git a/src/buildstream/_testing/_sourcetests/mirror.py b/src/buildstream/_testing/_sourcetests/mirror.py index ef6710ddf..f08ec645e 100644 --- a/src/buildstream/_testing/_sourcetests/mirror.py +++ b/src/buildstream/_testing/_sourcetests/mirror.py @@ -19,7 +19,6 @@ import os import pytest from buildstream import _yaml -from buildstream.exceptions import ErrorDomain from .._utils import generate_junction from .. import create_repo from .. import cli # pylint: disable=unused-import @@ -191,60 +190,6 @@ def test_mirror_from_includes(cli, tmpdir, datafiles, kind): result.assert_success() [email protected](DATA_DIR) -def test_mirror_junction_from_includes(cli, tmpdir, datafiles, kind): - project_dir = str(datafiles) - bin_files_path = os.path.join(project_dir, "files", "bin-files", "usr") - upstream_repodir = os.path.join(str(tmpdir), "upstream") - mirror_repodir = os.path.join(str(tmpdir), "mirror") - element_dir = os.path.join(project_dir, "elements") - - # Create repo objects of the upstream and mirror - upstream_repo = create_repo(kind, upstream_repodir) - upstream_ref = upstream_repo.create(bin_files_path) - mirror_repo = upstream_repo.copy(mirror_repodir) - - element = {"kind": "junction", "sources": [upstream_repo.source_config(ref=upstream_ref)]} - element_name = "test.bst" - element_path = os.path.join(element_dir, element_name) - full_repo = element["sources"][0]["url"] - upstream_map, repo_name = os.path.split(full_repo) - alias = "foo-" + kind - aliased_repo = alias + ":" + repo_name - element["sources"][0]["url"] = aliased_repo - full_mirror = mirror_repo.source_config()["url"] - mirror_map, _ = os.path.split(full_mirror) - _yaml.roundtrip_dump(element, element_path) - - config_project_dir = str(tmpdir.join("config")) - os.makedirs(config_project_dir, exist_ok=True) - config_project = {"name": "config", "min-version": "2.0"} - _yaml.roundtrip_dump(config_project, os.path.join(config_project_dir, "project.conf")) - extra_mirrors = { - "mirrors": [ - { - "name": "middle-earth", - "aliases": { - alias: [mirror_map + "/"], - }, - } - ] - } - _yaml.roundtrip_dump(extra_mirrors, os.path.join(config_project_dir, "mirrors.yml")) - generate_junction(str(tmpdir.join("config_repo")), config_project_dir, os.path.join(element_dir, "config.bst")) - - _set_project_includes_and_aliases(project_dir, ["config.bst:mirrors.yml"], {alias: upstream_map + "/"}) - - # Now make the upstream unavailable. - os.rename(upstream_repo.repo, "{}.bak".format(upstream_repo.repo)) - result = cli.run(project=project_dir, args=["source", "fetch", element_name]) - result.assert_main_error(ErrorDomain.STREAM, None) - # Now make the upstream available again. - os.rename("{}.bak".format(upstream_repo.repo), upstream_repo.repo) - result = cli.run(project=project_dir, args=["source", "fetch", element_name]) - result.assert_success() - - @pytest.mark.datafiles(DATA_DIR) def test_mirror_track_upstream_present(cli, tmpdir, datafiles, kind): project_dir = str(datafiles)
