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/4] 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/4] 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( From cbaf6907f6b2fecb0c6302f22a4f1cb57ca60e65 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: Tue, 1 Sep 2026 00:29:05 +0300 Subject: [PATCH 3/4] Update SystemStatusTests.swift --- Tests/ContainerCommandsTests/SystemStatusTests.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/ContainerCommandsTests/SystemStatusTests.swift b/Tests/ContainerCommandsTests/SystemStatusTests.swift index 0790aa5dd..3504794a4 100644 --- a/Tests/ContainerCommandsTests/SystemStatusTests.swift +++ b/Tests/ContainerCommandsTests/SystemStatusTests.swift @@ -125,3 +125,4 @@ struct SystemStatusTests { #expect(decoded.resources?.containersRunning == 4) } } + From 2e32144143ba75c4b28e5c07b901cadfe3fb469f 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: Tue, 1 Sep 2026 00:41:59 +0300 Subject: [PATCH 4/4] style: format SystemStatusTests.swift --- Tests/ContainerCommandsTests/SystemStatusTests.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/ContainerCommandsTests/SystemStatusTests.swift b/Tests/ContainerCommandsTests/SystemStatusTests.swift index 3504794a4..7b6cc2fe2 100644 --- a/Tests/ContainerCommandsTests/SystemStatusTests.swift +++ b/Tests/ContainerCommandsTests/SystemStatusTests.swift @@ -119,10 +119,9 @@ struct SystemStatusTests { ) 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) } } -