You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:32:40 UTC

[buildstream] branch traveltissues/fix-Nonetype-guard created (now d2eaec4)

This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a change to branch traveltissues/fix-Nonetype-guard
in repository https://gitbox.apache.org/repos/asf/buildstream.git.


      at d2eaec4  wip

This branch includes the following new commits:

     new 6469757  _project: Guard against addition of None to list
     new d2eaec4  wip

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[buildstream] 01/02: _project: Guard against addition of None to list

Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch traveltissues/fix-Nonetype-guard
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 6469757d851df8cdc9c54ab6e87e8d0edd91579f
Author: Darius Makovsky <tr...@protonmail.com>
AuthorDate: Thu May 28 10:07:50 2020 +0100

    _project: Guard against addition of None to list
    
    When parent.artifact_cache_specs are None `+` is not a valid operation
---
 src/buildstream/_project.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index 21dc2b9..c396408 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -848,7 +848,7 @@ class Project:
             if self.junction.ignore_junction_remotes:
                 self.artifact_cache_specs = []
 
-            if self.junction.cache_junction_elements:
+            if self.junction.cache_junction_elements and parent.artifact_cache_specs:
                 self.artifact_cache_specs = parent.artifact_cache_specs + self.artifact_cache_specs
 
         # Load source caches with pull/push config


[buildstream] 02/02: wip

Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch traveltissues/fix-Nonetype-guard
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit d2eaec482925587431d926a14a8b3142e9eac018
Author: Darius Makovsky <tr...@protonmail.com>
AuthorDate: Mon Jul 6 09:13:10 2020 +0100

    wip
---
 tests/artifactcache/junctions.py | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py
index df7ee94..aa9ea04 100644
--- a/tests/artifactcache/junctions.py
+++ b/tests/artifactcache/junctions.py
@@ -132,6 +132,44 @@ def test_caching_junction_elements(cli, tmpdir, datafiles):
 
 
 @pytest.mark.datafiles(DATA_DIR)
+def test_caching_junction_elements_no_parent_cache(cli, tmpdir, datafiles):
+    project = os.path.join(str(datafiles), "parent")
+    base_project = os.path.join(str(project), "base")
+
+    # Load the junction element
+    junction_element = os.path.join(project, "base.bst")
+    junction_data = _yaml.roundtrip_load(junction_element)
+
+    # Configure to push everything to the junction's remote
+    junction_data["config"] = {"cache-junction-elements": True}
+    _yaml.roundtrip_dump(junction_data, junction_element)
+
+    with create_artifact_share(os.path.join(str(tmpdir), "artifactshare-base")) as base_share:
+
+        # First build it without the artifact cache configured
+        result = cli.run(project=project, args=["build", "target.bst"])
+        assert result.exit_code == 0
+
+        # Assert that we are now cached locally
+        state = cli.get_element_state(project, "target.bst")
+        assert state == "cached"
+        state = cli.get_element_state(base_project, "base-element.bst")
+        assert state == "cached"
+
+        project_set_artifacts(base_project, base_share.repo)
+
+        # Push to the remote(s))
+        result = cli.run(project=project, args=["artifact", "push", "--deps", "all", "target.bst"])
+        assert result.exit_code == 0
+
+        # And finally assert that the artifacts are in the right shares
+        # The junction project's cache should contain only junction elements
+        assert_not_shared(cli, base_share, project, "target.bst", project_name="parent")
+        assert_not_shared(cli, base_share, project, "app.bst", project_name="parent")
+        assert_shared(cli, base_share, base_project, "base-element.bst", project_name="base")
+
+
+@pytest.mark.datafiles(DATA_DIR)
 def test_ignore_junction_remotes(cli, tmpdir, datafiles):
     project = os.path.join(str(datafiles), "parent")
     base_project = os.path.join(str(project), "base")