Correzioni della revisione di C6: installatore, CI senza jq, caratteri e schermate senza Node
Le 14 osservazioni della revisione di funzione/senza-terzi, ciascuna con la prova che l'avrebbe trovata. Installatore: un aggiornamento senza /D= va nella cartella già installata (InstallLocation) invece che in quella predefinita, che lasciava la vecchia copia. Una cartella senza permessi non sembra più «Febe aperto». La dimensione in «App installate» conta solo i due file dell'installatore. I file in sola lettura si sostituiscono e si tolgono. «Febe» in Esegui all'avvio si toglie solo se avvia quella copia, non un Febe portatile. Febe parte alla fine solo con «Fine» e la casella spuntata. /PROVA= rifiuta la radice di un disco. CI: jq non c'era ed era un componente esterno. JSON letto e scritto con .gitea/scripts/json.sh (json-campi.awk e json-stringa.awk sul lettore json.awk) per gitleaks, Trivy e la release. Le credenziali del registro stanno solo in un DOCKER_CONFIG temporaneo della pubblicazione, con plugin, contesti e contesto corrente del runner, tolto alla fine. Le prove del rilascio girano in debian:trixie con Chromium, come la verifica, senza prove saltate. Ogni flusso usa shell: bash. Caratteri: tolti fonts-liberation e fonts-noto-color-emoji dall'immagine e dalle prove della CI, perché Chromium non li chiede. Resta fonts-dejavu-core. Icone: la prova della griglia legge davvero i percorsi SVG (tutti i comandi, archi e curve) e i punti. La lettura dei nomi delle icone vede ogni forma con cui l'interfaccia li chiede. Schermate: tools/schermate (Node) diventa tools/Febe.Schermate, in C# con ClientWebSocket e System.Text.Json, nessun pacchetto, solo verso indirizzi di questo computer. Provato contro una dimostrazione con Edge su Windows. Documenti: CLAUDE.md, processo, guida, LEGGIMI e docker.md aggiornati. Righe nuove in decisioni.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
525d7dfdaa
commit
be662f2d28
46 files changed
+2091
-283
No files matched your search
@@ -116,6 +116,13 @@ public sealed partial class InstallerTests
|
||||
Assert.ThrowsExactly<ArgumentException>(() => CommandLine.Parse(["/D=relativa"]));
|
||||
Assert.ThrowsExactly<ArgumentException>(() => CommandLine.Parse(["/D="]));
|
||||
|
||||
// /PROVA= at the root of a drive: refused here, with its message, not later as an unhandled crash (the name of
|
||||
// the folder is the registry key of the test, and a root has none).
|
||||
var driveRoot = Path.GetPathRoot(Path.GetTempPath())!;
|
||||
var refused = Assert.ThrowsExactly<ArgumentException>(() => CommandLine.Parse(["/S", "/PROVA=" + driveRoot]));
|
||||
StringAssert.Contains(refused.Message, "/PROVA=");
|
||||
Assert.ThrowsExactly<ArgumentException>(() => Locations.ForTest(driveRoot), "what Parse refuses is what ForTest would refuse");
|
||||
|
||||
// The build tool.
|
||||
Assert.AreEqual(ToolCommand.Pack, CommandLine.Parse(["--impacchetta", "a", "b", "1.0.0", "c"]).Tool);
|
||||
Assert.AreEqual(ToolCommand.Verify, CommandLine.Parse(["--verifica", "a", "b"]).Tool);
|
||||
@@ -194,6 +201,104 @@ public sealed partial class InstallerTests
|
||||
Assert.IsEmpty(bed.System.Started, "«Apri Febe adesso» unchecked");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AnUpdateWithoutAFolderGoesWhereFebeIsAlreadyInstalled()
|
||||
{
|
||||
using var bed = new SetupBed("dove-era");
|
||||
var folder = Path.Combine(bed.Root, "Altrove", "Febe");
|
||||
var first = bed.Package("0.1.1", seed: 20);
|
||||
Assert.AreEqual(ExitCodes.Done, bed.Flow(new ScriptedInterface()).Install(first, Package.Read(first)!, CommandLine.Parse(["/D=" + folder])));
|
||||
|
||||
// With the dialogs: the first page names the folder where Febe is, and the update replaces that program.
|
||||
var second = bed.Package("0.2.0", seed: 21);
|
||||
var ui = new ScriptedInterface();
|
||||
Assert.AreEqual(ExitCodes.Done, bed.Flow(ui).Install(second, Package.Read(second)!, new CommandLine()));
|
||||
Assert.AreEqual(folder, ui.Folder);
|
||||
Assert.AreEqual("0.1.1", ui.Version);
|
||||
CollectionAssert.AreEqual(bed.Program(21), File.ReadAllBytes(Path.Combine(folder, "Febe.exe")));
|
||||
Assert.IsFalse(Directory.Exists(bed.Locations.DefaultInstallFolder), "no second Febe in the default folder");
|
||||
Assert.AreEqual(folder, bed.System.String(bed.Locations.UninstallKey, "InstallLocation"));
|
||||
Assert.IsTrue(bed.System.Shortcuts.All(s => s.Target == Path.Combine(folder, "Febe.exe")));
|
||||
|
||||
// Silent too; and a Febe open there is seen there.
|
||||
var third = bed.Package("0.3.0", seed: 22);
|
||||
using (new FileStream(Path.Combine(folder, "Febe.exe"), FileMode.Open, FileAccess.Read, FileShare.None))
|
||||
{
|
||||
var errors = new StringWriter();
|
||||
Assert.AreEqual(ExitCodes.Failed, bed.Flow(new SilentInterface(errors)).Install(third, Package.Read(third)!, CommandLine.Parse(["/S"])));
|
||||
StringAssert.Contains(errors.ToString(), "Febe è aperto");
|
||||
}
|
||||
|
||||
Assert.AreEqual(ExitCodes.Done, bed.Flow(new SilentInterface(TextWriter.Null)).Install(third, Package.Read(third)!, CommandLine.Parse(["/S"])));
|
||||
CollectionAssert.AreEqual(bed.Program(22), File.ReadAllBytes(Path.Combine(folder, "Febe.exe")));
|
||||
Assert.IsFalse(Directory.Exists(bed.Locations.DefaultInstallFolder));
|
||||
|
||||
// /D= still decides when given; an entry whose folder is not a full path counts as none.
|
||||
var actions = new SetupActions(bed.System, bed.Locations);
|
||||
Assert.AreEqual(folder, actions.InstalledFolder());
|
||||
bed.System.WriteUserString(bed.Locations.UninstallKey, "InstallLocation", "Programs\\Febe");
|
||||
Assert.IsNull(actions.InstalledFolder());
|
||||
bed.System.WriteUserString(bed.Locations.UninstallKey, "InstallLocation", folder + Path.DirectorySeparatorChar);
|
||||
Assert.AreEqual(folder, actions.InstalledFolder());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TheSizeInAppsInstalledCountsOnlyTheFilesOfTheInstaller()
|
||||
{
|
||||
using var bed = new SetupBed("dimensione");
|
||||
var folder = Path.Combine(bed.Root, "Disco", "Febe");
|
||||
|
||||
// A folder with something else in it, and below it: never walked (a drive root would have folders nobody may read).
|
||||
Directory.CreateDirectory(Path.Combine(folder, "altro", "dentro"));
|
||||
File.WriteAllBytes(Path.Combine(folder, "altro", "dentro", "grande.bin"), new byte[3 * 1024 * 1024]);
|
||||
File.WriteAllBytes(Path.Combine(folder, "accanto.bin"), new byte[1024 * 1024]);
|
||||
var setup = bed.Package("0.1.2", seed: 23);
|
||||
Assert.AreEqual(ExitCodes.Done, bed.Flow(new ScriptedInterface()).Install(setup, Package.Read(setup)!, CommandLine.Parse(["/D=" + folder])));
|
||||
|
||||
var ours = new FileInfo(Path.Combine(folder, "Febe.exe")).Length + new FileInfo(Path.Combine(folder, "Disinstalla Febe.exe")).Length;
|
||||
Assert.AreEqual((int)(ours / 1024), bed.System.ReadUserDword(bed.Locations.UninstallKey, "EstimatedSize"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AReadOnlyFebeIsNotAnOpenFebeAndIsReplacedAndRemoved()
|
||||
{
|
||||
using var bed = new SetupBed("sola-lettura");
|
||||
var first = bed.Package("0.1.1", seed: 24);
|
||||
Assert.AreEqual(ExitCodes.Done, bed.Flow(new ScriptedInterface()).Install(first, Package.Read(first)!, new CommandLine()));
|
||||
var folder = bed.Locations.DefaultInstallFolder;
|
||||
var executable = Path.Combine(folder, "Febe.exe");
|
||||
var uninstaller = Path.Combine(folder, "Disinstalla Febe.exe");
|
||||
try
|
||||
{
|
||||
// Left read-only by a copy or a restore: Windows refuses to open it for writing, but nothing is running.
|
||||
File.SetAttributes(executable, File.GetAttributes(executable) | FileAttributes.ReadOnly);
|
||||
File.SetAttributes(uninstaller, File.GetAttributes(uninstaller) | FileAttributes.ReadOnly);
|
||||
Assert.IsFalse(SetupActions.IsFebeOpen(folder), "«Riprova» could never help: not «Febe è aperto»");
|
||||
|
||||
var second = bed.Package("0.2.0", seed: 25);
|
||||
var ui = new ScriptedInterface { Retries = new Queue<bool>([true, true, false]) };
|
||||
Assert.AreEqual(ExitCodes.Done, bed.Flow(ui).Install(second, Package.Read(second)!, new CommandLine()));
|
||||
CollectionAssert.AreEqual(new[] { "benvenuto", "avanzamento", "installato" }, ui.Calls);
|
||||
CollectionAssert.AreEqual(bed.Program(25), File.ReadAllBytes(executable));
|
||||
|
||||
File.SetAttributes(executable, File.GetAttributes(executable) | FileAttributes.ReadOnly);
|
||||
File.SetAttributes(uninstaller, File.GetAttributes(uninstaller) | FileAttributes.ReadOnly);
|
||||
Assert.AreEqual(ExitCodes.Done, bed.Flow(new ScriptedInterface()).Uninstall(Path.Combine(bed.Locations.Temp, "copia.exe"), CommandLine.Parse(["/_?=" + folder])));
|
||||
Assert.IsFalse(File.Exists(executable));
|
||||
Assert.IsFalse(File.Exists(uninstaller));
|
||||
}
|
||||
finally
|
||||
{
|
||||
foreach (var file in new[] { executable, uninstaller })
|
||||
{
|
||||
if (File.Exists(file))
|
||||
{
|
||||
File.SetAttributes(file, FileAttributes.Normal);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AnInstallationOverAnotherReplacesTheProgramAndKeepsTheData()
|
||||
{
|
||||
@@ -290,10 +395,14 @@ public sealed partial class InstallerTests
|
||||
CollectionAssert.AreEqual(new[] { "conferma", "disinstallato" }, ui.Calls);
|
||||
Assert.AreEqual((data.MovedDataFolder, bed.Locations.Library), ui.UninstalledWith);
|
||||
|
||||
// A second time, with the program folder now empty: the folder goes too.
|
||||
// A second time, with the program folder now empty: the folder goes too. Meanwhile a portable Febe with the
|
||||
// default Data folder took «Febe» for itself: it starts another Febe.exe, so it stays.
|
||||
File.Delete(Path.Combine(folder, "appunti.txt"));
|
||||
var portable = Autostart.Command(Path.Combine(bed.Root, "Portabile", "Febe.exe"));
|
||||
bed.System.WriteUserString(run, "Febe", portable);
|
||||
Assert.AreEqual(ExitCodes.Done, bed.Flow(new ScriptedInterface()).Uninstall(Path.Combine(bed.Locations.Temp, "copia.exe"), CommandLine.Parse(["/_?=" + folder])));
|
||||
Assert.IsFalse(Directory.Exists(folder));
|
||||
Assert.AreEqual(portable, bed.System.String(run, "Febe"), "«Febe» of another Febe.exe is not ours to remove");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
|
||||
Reference in new issue
Block a user