subrascasse

Sub Rascasse: an iPhone dive log for Subsurface cloud storage, with a pure-Swift git client (GPL-2.0)
git clone https://git.schurger.org/subrascasse.git
Log | Files | Refs | README | LICENSE

commit 16d3336a3fbb480d5279dc719cd1cb6f9d8b8618
parent 9202f82f13371bcf178561f1d4c752b8c022f1f5
Author: Jean Schurger <jean@schurger.org>
Date:   Fri, 13 Nov 2026 17:40:44 -0500

Read-only test against the real cloud (CLOUD_EMAIL, CLOUD_PASSWORD)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7deYG3yp7VDUZJzSBkvTc

Diffstat:
MPackages/DiveKit/Tests/SubsurfaceLogTests/HTTPTests.swift | 19+++++++++++++++++++
1 file changed, 19 insertions(+), 0 deletions(-)

diff --git a/Packages/DiveKit/Tests/SubsurfaceLogTests/HTTPTests.swift b/Packages/DiveKit/Tests/SubsurfaceLogTests/HTTPTests.swift @@ -51,4 +51,23 @@ final class HTTPTests: XCTestCase { log = try await other.logbook() XCTAssertEqual(log.dives.last?.buddy, "Par HTTP") } + + /// Vrai nuage, en lecture seule : CLOUD_EMAIL et CLOUD_PASSWORD dans l'environnement. N'envoie rien. + func testRealCloudReadOnly() async throws { + let env = ProcessInfo.processInfo.environment + guard let email = env["CLOUD_EMAIL"], let password = env["CLOUD_PASSWORD"] else { throw XCTSkip("CLOUD_EMAIL non défini") } + let transport = SubsurfaceCloud.transport(email: email, password: password) + print("CLOUD url=\(transport.baseURL.absoluteString)") + let refs = try await GitClient(transport: transport, store: MemoryObjectStore()).refs() + print("CLOUD refs=\(refs.refs.keys.sorted()) caps=\(refs.capabilities.sorted())") + let repo = try LogRepository(directory: try LocalGit.temporaryDirectory("cloud"), branch: SubsurfaceCloud.sanitize(email: email), + authorName: "DiveLog", authorEmail: email) + let report = try await repo.sync(transport: transport) + XCTAssertEqual(report.sent, []) + let log = try await repo.logbook() + print("CLOUD plongées=\(log.dives.count) lieux=\(log.sites.count) voyages=\(log.trips.count) avertissements=\(log.warnings)") + var samples = 0 + for dive in log.dives { samples += (try await repo.profile(of: dive)).reduce(0) { $0 + $1.samples.count } } + print("CLOUD échantillons=\(samples) numéros=\(log.dives.first?.number ?? 0)…\(log.dives.last?.number ?? 0) modèles=\(Set(log.dives.compactMap(\.computerModel)).sorted())") + } }