From bc00cce47fb0954208d9b391698ae85d992332d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20G=C3=BCney=20Y=C4=B1ld=C4=B1r=C4=B1m?= <31777283+denizguney@users.noreply.github.com> Date: Mon, 31 Aug 2026 00:44:26 +0300 Subject: [PATCH 1/2] Test: add full payload JSON round-trip test in SystemStatusTests Adds a new unit test to verify that system status payloads with nested paths and resource counts correctly round-trip through JSON encoding and decoding. --- .../ContainerCommandsTests/SystemStatusTests.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Tests/ContainerCommandsTests/SystemStatusTests.swift b/Tests/ContainerCommandsTests/SystemStatusTests.swift index 25e324949..3d66f8408 100644 --- a/Tests/ContainerCommandsTests/SystemStatusTests.swift +++ b/Tests/ContainerCommandsTests/SystemStatusTests.swift @@ -110,4 +110,17 @@ struct SystemStatusTests { let updated = Application.SystemStatus.withImageCount(resources, imageCount: nil) #expect(updated?.images == nil) } + @Test + func fullPayloadRoundTripsThroughJSON() throws { + let payload = makeRunningPayload( + paths: Application.PathInfo(appRoot: "/app", installRoot: "/install", logRoot: "/log"), + resources: Application.ResourceCounts(containersTotal: 10, containersRunning: 4) + ) + let json = try Output.renderJSON(payload) + let decoded = try JSONDecoder().decode(Application.StatusPayload.self, from: Data(json.utf8)) + + #expect(decoded.paths?.appRoot == "/app") + #expect(decoded.resources?.containersTotal == 10) + #expect(decoded.resources?.containersRunning == 4) + } } From 19e25a1cdddb13b5711768e59509dbb9bd76589b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20G=C3=BCney=20Y=C4=B1ld=C4=B1r=C4=B1m?= <31777283+denizguney@users.noreply.github.com> Date: Mon, 31 Aug 2026 18:38:01 +0300 Subject: [PATCH 2/2] Add test for fullPayloadRoundTripsThroughJSON Add missing whitespace before the test method as requested in the review nit. --- Tests/ContainerCommandsTests/SystemStatusTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/ContainerCommandsTests/SystemStatusTests.swift b/Tests/ContainerCommandsTests/SystemStatusTests.swift index 3d66f8408..0790aa5dd 100644 --- a/Tests/ContainerCommandsTests/SystemStatusTests.swift +++ b/Tests/ContainerCommandsTests/SystemStatusTests.swift @@ -110,6 +110,7 @@ struct SystemStatusTests { let updated = Application.SystemStatus.withImageCount(resources, imageCount: nil) #expect(updated?.images == nil) } + @Test func fullPayloadRoundTripsThroughJSON() throws { let payload = makeRunningPayload(