Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/buildstream/sandbox/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def __init__(
# Returns:
# A dictionary representation of this SandboxConfig
#
def to_dict(self) -> Dict[str, Union[str, int, bool]]:
def to_dict(self) -> Dict[str, Union[str, int, Dict]]:

# Assign mandatory portions of the sandbox configuration
#
# /!\ No additional mandatory members can ever be added to
# the sandbox configuration, as that would result in
# breaking cache key stability.
#
sandbox_dict: Dict[str, Union[str, int, bool]] = {"build-os": self.build_os, "build-arch": self.build_arch}
sandbox_dict: Dict[str, Union[str, int, Dict]] = {"build-os": self.build_os, "build-arch": self.build_arch}

# Assign optional portions of the sandbox configuration
#
Expand All @@ -98,9 +98,10 @@ def to_dict(self) -> Dict[str, Union[str, int, bool]]:
sandbox_dict["build-gid"] = self.build_gid

if self.remote_apis_socket_path is not None:
sandbox_dict["remote-apis-socket-path"] = self.remote_apis_socket_path
reapi_socket_dict: Dict[str, Union[str, bool]] = {"path": self.remote_apis_socket_path}
if self.remote_apis_socket_action_cache_enable_update:
sandbox_dict["remote-apis-socket-action-cache-enable-update"] = True
reapi_socket_dict["action-cache-enable-update"] = True
sandbox_dict["remote-apis-socket"] = reapi_socket_dict

return sandbox_dict

Expand Down
10 changes: 10 additions & 0 deletions tests/integration/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def test_remote_apis_socket(cli, datafiles):
result = cli.run(project=project, args=["build", element_name])
assert result.exit_code == 0

# Verify that loading the artifact succeeds
artifact_name = cli.get_artifact_name(project, "test", element_name)
result = cli.run(project=project, args=["artifact", "show", artifact_name])
assert result.exit_code == 0


# Test configuration with remote action cache for nested REAPI.
@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
Expand Down Expand Up @@ -103,6 +108,11 @@ def test_remote_apis_socket_with_action_cache_update(cli, tmpdir, datafiles):
result = cli.run(project=project, args=["build", element_name])
assert result.exit_code == 0

# Verify that loading the artifact succeeds
artifact_name = cli.get_artifact_name(project, "test", element_name)
result = cli.run(project=project, args=["artifact", "show", artifact_name])
assert result.exit_code == 0


# Test configuration with cache storage-service and remote action cache for nested REAPI.
@pytest.mark.skipif(not HAVE_SANDBOX, reason="Only available with a functioning sandbox")
Expand Down
Loading