Buckets:
localhost1978/localhost / LOCALHOST1978 /SSK_DocGen /Tests /SSK_DocGenTests /EndToEndGenerationTests.swift
| import Foundation | |
| import Testing | |
| @testable import SSK_DocGen | |
| @testable import SSK_Orchestrator | |
| @testable import SSK_Abstractions | |
| @testable import SSK_Providers | |
| ("End-to-End Documentation Generation") | |
| struct EndToEndGenerationTests { | |
| private actor MockIdentitySettlementCoordinator: IdentitySettlementCoordinating { | |
| var identityService: any IdentityServiceProviding = ZKIdentityService() | |
| var lastVerifiedClaims: IdentityClaimsPayload? = nil | |
| func archiveIdentityService() throws -> any IdentityManaging { | |
| throw IdentitySettlementError.archiveSigningUnavailable | |
| } | |
| func assertDeviceBinding(sessionURI: SSKURI) async throws {} | |
| func conductIdentityPhase(sessionURI: SSKURI, psi: Double, claims: ZKClaims) async throws -> BilateralSettlementZKProof { | |
| return BilateralSettlementZKProof(age: 25, stateSignature: "mock_sig", jurisdiction: "US-CA") | |
| } | |
| } | |
| ("runGenerateDocs processes Swift files and emits ledger artifacts") | |
| @available(macOS 27.0, iOS 27.0, *) | |
| func testEndToEndPipeline() async throws { | |
| let root = FileManager.default.temporaryDirectory | |
| .appendingPathComponent("SSK-E2E-\(UUID().uuidString)", isDirectory: true) | |
| defer { try? FileManager.default.removeItem(at: root) } | |
| let workspace = root.appendingPathComponent("workspace", isDirectory: true) | |
| let vault = root.appendingPathComponent("vault", isDirectory: true) | |
| let moduleDir = workspace.appendingPathComponent("Modules/E2ECore/Sources/E2ECore", isDirectory: true) | |
| try FileManager.default.createDirectory(at: moduleDir, withIntermediateDirectories: true) | |
| try FileManager.default.createDirectory(at: vault, withIntermediateDirectories: true) | |
| let sourceFile = """ | |
| import Foundation | |
| /// A critical piece of infrastructure for E2E tests. | |
| public class EndToEndService { | |
| public init() {} | |
| public func execute() {} | |
| } | |
| """ | |
| try sourceFile.write(to: moduleDir.appendingPathComponent("EndToEndService.swift"), atomically: true, encoding: .utf8) | |
| let mockCoordinator = MockIdentitySettlementCoordinator() | |
| let report = try await SSK_DocGen.runGenerateDocs( | |
| workspaceURL: workspace, | |
| vaultURL: vault, | |
| clean: true, | |
| emitDoccCatalogs: true, | |
| enableAISummaries: false, | |
| settlementCoordinator: mockCoordinator | |
| ) | |
| // Verify report metrics | |
| #expect(report.filesDiscovered == 1) | |
| #expect(report.filesProcessed == 1) | |
| #expect(report.artifactsWritten > 0) | |
| // Verify ledger structure | |
| let ledgerDir = vault.appendingPathComponent("ledger") | |
| #expect(FileManager.default.fileExists(atPath: ledgerDir.path)) | |
| // Verify index JSON | |
| let indexFile = ledgerDir.appendingPathComponent("docc_index.json") | |
| #expect(FileManager.default.fileExists(atPath: indexFile.path)) | |
| let indexData = try Data(contentsOf: indexFile) | |
| let indexJSON = try JSONSerialization.jsonObject(with: indexData) as? [String: Any] | |
| let entities = indexJSON?["entities"] as? [[String: Any]] | |
| #expect(entities?.contains(where: { $0["name"] as? String == "EndToEndService" }) == true) | |
| // Verify graph JSON | |
| let graphFile = ledgerDir.appendingPathComponent("graph.json") | |
| #expect(FileManager.default.fileExists(atPath: graphFile.path)) | |
| // Verify .docc catalogs | |
| let doccDir = ledgerDir.appendingPathComponent("docc_catalogs") | |
| #expect(FileManager.default.fileExists(atPath: doccDir.path)) | |
| let catalogs = try FileManager.default.contentsOfDirectory(atPath: doccDir.path) | |
| #expect(catalogs.contains("E2ECore.docc")) | |
| } | |
| } | |
Xet Storage Details
- Size:
- 3.88 kB
- Xet hash:
- 7651d6b584be0d8786735ffc491e163010e6457596831d5404c456f969ef1cc4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.