From d9d8a296b1066449cd6139645c62ab74c260ae61 Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Tue, 20 Oct 2026 13:08:58 +0200 Subject: [PATCH] Prove dei percorsi uguali su Linux e su Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tre prove scrivevano i percorsi attesi alla Linux («/tmp/febe-profilo», «/importa», la radice seguita da «/») e fallivano su Windows, dove il prodotto dà giustamente il percorso completo sull'unità corrente o il percorso scritto con «/». Ora l'atteso si calcola come lo calcola il sistema: su Linux il testo resta identico a prima, su Windows le prove passano dove gira Febe per Windows. Co-Authored-By: Claude Opus 5.5 --- docs/decisioni.md | 1 + tests/Febe.Tests/Browser/HostingTests.cs | 4 +++- tests/Febe.Tests/Import/ImportSourcesTests.cs | 3 ++- tests/Febe.Tests/Web/ImportApiTests.cs | 6 ++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/decisioni.md b/docs/decisioni.md index be3e037..40d1f10 100644 --- a/docs/decisioni.md +++ b/docs/decisioni.md @@ -226,3 +226,4 @@ Ogni scelta tecnica presa strada facendo, con data e motivo (specifica §15). | 2026-10-13 | Prove dell'interfaccia in un Chromium senza finestra guidato col protocollo DevTools diretto (`UiBrowser`, solo 127.0.0.1), inconcludenti senza Chromium | Come `tools/schermate`; il client CDP di Febe accetta solo letture | | 2026-10-14 | Revisione avversaria di tutto il codice (7 aree, ogni rilievo verificato da un secondo revisore indipendente): 54 rilievi confermati e corretti con prove di regressione, 2 smentiti, 3 incerti corretti dove il rimedio era sicuro | §14, regola 14: resoconti onesti | | 2026-10-14 | Restano noti e accettati: «Tieni il più grande» scrive con il proprio SafeFileWriter e non passa dal lucchetto per account di `LibraryIngest` (un'importazione e uno scaricamento con gli stessi byte nello stesso istante potrebbero entrare entrambi); le prove d'interfaccia con browser vero aspettano fino a 30 s | Finestra rarissima, nessuna perdita di dati: al più un doppione esatto da togliere a mano | +| 2026-10-20 | Prove portabili fra Linux e Windows: i percorsi attesi si calcolano come li calcola il sistema (`Path.GetFullPath` per il profilo del browser e per `/importa`, `LibraryLayout.ToStored` per il percorso mostrato in Docker) invece di essere scritti alla Linux | Febe per Windows gira su Windows e le prove devono passare dove gira il prodotto; su Linux il testo atteso è identico a prima, quindi lì non cambia nulla | diff --git a/tests/Febe.Tests/Browser/HostingTests.cs b/tests/Febe.Tests/Browser/HostingTests.cs index a44cc66..76d663f 100644 --- a/tests/Febe.Tests/Browser/HostingTests.cs +++ b/tests/Febe.Tests/Browser/HostingTests.cs @@ -15,7 +15,9 @@ public sealed class HostingTests var args = ChromiumCommandLine.Build(Options, new ChromiumLaunchOptions()); CollectionAssert.Contains(args.ToList(), "--remote-debugging-port=9333"); - CollectionAssert.Contains(args.ToList(), "--user-data-dir=/tmp/febe-profilo"); + + // The profile reaches Chromium as a full path: «/tmp/febe-profilo» on Linux, rooted on the current drive on Windows. + CollectionAssert.Contains(args.ToList(), $"--user-data-dir={Path.GetFullPath(Options.ProfileDirectory)}"); CollectionAssert.Contains(args.ToList(), "--no-first-run"); CollectionAssert.Contains(args.ToList(), "--no-default-browser-check"); CollectionAssert.Contains(args.ToList(), "--window-size=1280,900"); diff --git a/tests/Febe.Tests/Import/ImportSourcesTests.cs b/tests/Febe.Tests/Import/ImportSourcesTests.cs index 24353b8..9d95e72 100644 --- a/tests/Febe.Tests/Import/ImportSourcesTests.cs +++ b/tests/Febe.Tests/Import/ImportSourcesTests.cs @@ -27,7 +27,8 @@ public sealed class ImportSourcesTests Assert.AreEqual(Path.Combine(root, "4K Stogram"), info.FullPath); Assert.IsTrue(info.ReadOnly, "Il volume /importa è in sola lettura."); Assert.IsFalse(info.CanMove); - Assert.AreEqual(root + "/4K Stogram", info.DisplayPath); + // Shown as in the container, with «/»: the same text as the root on Linux; on Windows the separators change too. + Assert.AreEqual(LibraryLayout.ToStored(root) + "/4K Stogram", info.DisplayPath); var outside = Assert.ThrowsExactly(() => sources.Inspect(temp.Combine("fuori"))); StringAssert.Contains(outside.Message, "sottocartella"); diff --git a/tests/Febe.Tests/Web/ImportApiTests.cs b/tests/Febe.Tests/Web/ImportApiTests.cs index 7908a86..ea99530 100644 --- a/tests/Febe.Tests/Web/ImportApiTests.cs +++ b/tests/Febe.Tests/Web/ImportApiTests.cs @@ -163,10 +163,12 @@ public sealed class ImportApiTests Assert.AreEqual(HttpStatusCode.BadRequest, sources, "desktop: the native picker, no listing"); } - // Docker: the sources live under /importa (absent on this machine: the listing says so). + // Docker: the sources live under /importa (absent on this machine: the listing says so). The root is reported as + // a full path: «/importa» in the container, rooted on the current drive where the edition runs for development + // on Windows. await using var docker = await Part2.StartAsync(); var overview = await docker.GetJsonAsync("/api/import"); - Assert.AreEqual("/importa", overview.Str("sourceRoot")); + Assert.AreEqual(Path.GetFullPath("/importa"), overview.Str("sourceRoot")); Assert.IsFalse(overview.Bool("pickFolder")); var (pick, _) = await docker.SendJsonAsync(HttpMethod.Post, "/api/import/pick-folder"); Assert.AreEqual(HttpStatusCode.BadRequest, pick);