From 2d40bfe35b18d92fa4b6500a23dacaea6a8fec1a Mon Sep 17 00:00:00 2001 From: Alberto Balbo Date: Thu, 26 Nov 2026 10:25:54 +0100 Subject: [PATCH] Prove: senza docs/ (costruzione dell'immagine) le due prove che li leggono si saltano MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nell'esecuzione 449 la costruzione dell'immagine si è fermata su due prove: InHouseAssetsTests (confronta la pila dei caratteri con docs/SPECIFICA.md) e ScreenshotToolTests (elenca docs/schermate). Dentro l'immagine i sorgenti arrivano senza docs/ (.dockerignore) e senza .git. Nuovo Repository.Docs, come GuideTests e ImageContentsTests: rende la prova non conclusiva solo in quella copia; in un checkout la prova va avanti e un percorso mancante la fa fallire. Provato togliendo docs/ e .git: le due prove risultano ignorate; con docs/ passano. Co-Authored-By: Claude Opus 5.5 --- tests/Febe.Tests/Desktop/Support/Repository.cs | 18 ++++++++++++++++++ tests/Febe.Tests/Web/InHouseAssetsTests.cs | 2 +- tests/Febe.Tests/Web/ScreenshotToolTests.cs | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/Febe.Tests/Desktop/Support/Repository.cs b/tests/Febe.Tests/Desktop/Support/Repository.cs index 269723d..21502a6 100644 --- a/tests/Febe.Tests/Desktop/Support/Repository.cs +++ b/tests/Febe.Tests/Desktop/Support/Repository.cs @@ -28,4 +28,22 @@ internal static class Repository return Path.Combine([root, .. parts]); } + + /// + /// A file or folder under docs/. The build of the Docker image copies the sources without docs/ (.dockerignore) and + /// without .git: there the test is inconclusive. In a checkout docs/ is always there, so the test goes on and a + /// missing path fails it. + /// + public static string Docs(params string[] parts) + { + var path = PathOf(["docs", .. parts]); + var root = Root()!; + var isCheckout = Directory.Exists(Path.Combine(root, ".git")) || File.Exists(Path.Combine(root, ".git")); + if (!Directory.Exists(Path.Combine(root, "docs")) && !isCheckout) + { + Assert.Inconclusive("Questa copia del repository non ha docs/ (costruzione dell'immagine Docker)."); + } + + return path; + } } diff --git a/tests/Febe.Tests/Web/InHouseAssetsTests.cs b/tests/Febe.Tests/Web/InHouseAssetsTests.cs index c887923..24b4cef 100644 --- a/tests/Febe.Tests/Web/InHouseAssetsTests.cs +++ b/tests/Febe.Tests/Web/InHouseAssetsTests.cs @@ -48,7 +48,7 @@ public sealed partial class InHouseAssetsTests // Exactly the stack of the specification (appendix B, «pila dei caratteri di sistema»), nothing more: no name of a // font the Docker image leaves out (Liberation). - var specification = File.ReadAllText(Febe.Tests.Desktop.Support.Repository.PathOf("docs", "SPECIFICA.md")); + var specification = File.ReadAllText(Febe.Tests.Desktop.Support.Repository.Docs("SPECIFICA.md")); var stated = SpecificationStack().Match(specification); Assert.IsTrue(stated.Success, "la pila dell'appendice B"); Assert.AreEqual(stated.Groups[1].Value, stack.Groups[1].Value.Trim()); diff --git a/tests/Febe.Tests/Web/ScreenshotToolTests.cs b/tests/Febe.Tests/Web/ScreenshotToolTests.cs index 6deabf1..0d9f7be 100644 --- a/tests/Febe.Tests/Web/ScreenshotToolTests.cs +++ b/tests/Febe.Tests/Web/ScreenshotToolTests.cs @@ -37,7 +37,7 @@ public sealed partial class ScreenshotToolTests [TestMethod] public void TheListTakesEveryScreenshotOfTheFolderOnceWithItsStep() { - var folder = Repository.PathOf("docs", "schermate"); + var folder = Repository.Docs("schermate"); var steps = Repository.PathOf("tools", "Febe.Schermate", "passi"); var files = Shots.All.Select(s => s.File).ToList(); CollectionAssert.AllItemsAreUnique(files);