E2: misure del filtro Copie, migrazione 0004 e prove di web e Docker
Il filtro «Copie» con 200.000 elementi stava al limite dei 250 ms («Copiati» 249 ms): la migrazione 0004 aggiunge solo l'indice ix_media_sha256_entry e la finestra scende a 160 ms. Totali e giorni contano «Copiati» partendo dalle copie e gli altri valori con un solo passaggio sui file dietro gli elenchi degli SHA-256 copiati (1,5 s -> 0,7 s); hanno un limite loro di 3 s, scritto in decisioni.md con le misure. «Copia di nuovo» sceglie un file dell'account che è sul disco: prima prendeva il primo con quello SHA-256 e, nella demo, a certe ore non scriveva nulla. Nuove prove: API delle copie, coerenza della demo, interfaccia nel browser, opzioni del server, avvio del contenitore con /esporta, contenuto dell'immagine e modelli, migrazione 4 e scala. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
736d241a38
commit
724db13e1b
14 files changed
+1403
-38
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System.Net;
|
||||
using Febe.Core.Abstractions;
|
||||
using Febe.Core.Export;
|
||||
using Febe.Server;
|
||||
using Febe.Tests.Support;
|
||||
using Febe.Web;
|
||||
@@ -28,6 +29,14 @@ public sealed class ServerOptionsTests
|
||||
Assert.AreEqual("instagram", o.Site.Name);
|
||||
Assert.AreEqual("https://www.instagram.com/accounts/login/", o.LoginUrl);
|
||||
Assert.IsEmpty(o.AllowedHostList(), "any host name by default");
|
||||
// Copie esterne (§4.10, §11): /esporta is the only root, and it is off until declared.
|
||||
Assert.IsFalse(o.ExportDeclared);
|
||||
Assert.AreEqual("/esporta", o.ExportFolder);
|
||||
var export = o.AppOptions().ExportRoot;
|
||||
Assert.IsFalse(export.Declared);
|
||||
Assert.AreEqual(ExportPaths.Trim(Path.GetFullPath("/esporta")), export.Root);
|
||||
Assert.IsFalse(ExportRoots.Evaluate(export).Active);
|
||||
Assert.Contains("Copie esterne = spente", o.ToString());
|
||||
|
||||
var web = o.WebOptions();
|
||||
Assert.AreEqual(FebeEdition.Docker, web.Edition);
|
||||
@@ -46,13 +55,17 @@ public sealed class ServerOptionsTests
|
||||
("FEBE_HOST", "tower.local, 192.168.1.10"),
|
||||
("FEBE_PROXY_FIDATO", "1"),
|
||||
("FEBE_SENZA_SANDBOX", "1"),
|
||||
("FEBE_PORTA_DEBUG", "9333"));
|
||||
("FEBE_PORTA_DEBUG", "9333"),
|
||||
("FEBE_ESPORTA", "1"));
|
||||
Assert.IsTrue(ServerOptions.TryParse(["--dati", "/tmp/d", "--sito-di-prova", "http://127.0.0.1:8481", "--accesso-di-prova", "--prima-sessione", "5"], env, out var o, out var problem), problem);
|
||||
Assert.AreEqual(9000, o.Port);
|
||||
Assert.AreEqual("Europe/London", o.ZoneId);
|
||||
Assert.IsTrue(o.TrustForwardedHost);
|
||||
Assert.IsTrue(o.NoSandbox);
|
||||
Assert.AreEqual(9333, o.DebugPort);
|
||||
Assert.IsTrue(o.ExportDeclared);
|
||||
Assert.IsTrue(o.AppOptions().ExportRoot.Declared);
|
||||
Assert.Contains("Copie esterne = dichiarate", o.ToString());
|
||||
Assert.AreEqual("/tmp/d", o.DataFolder);
|
||||
Assert.AreEqual(TimeSpan.FromSeconds(5), o.FirstSessionDelay);
|
||||
Assert.AreEqual("prova", o.Site.Name);
|
||||
@@ -62,6 +75,22 @@ public sealed class ServerOptionsTests
|
||||
Assert.AreEqual("http://127.0.0.1:8481/benvenuto", o.LoginUrl);
|
||||
CollectionAssert.IsSubsetOf(new[] { "tower.local", "tower.local:*", "192.168.1.10:*", "127.0.0.1:*", "localhost:*" }, o.AllowedHostList().ToList());
|
||||
|
||||
// --esporta is a bare flag (no value), and FEBE_ESPORTA takes the values of the other switches.
|
||||
Assert.IsTrue(ServerOptions.TryParse(["--esporta", "--porta", "9001"], Env(("FEBE_PASSWORD", "x")), out var flagged, out problem), problem);
|
||||
Assert.IsTrue(flagged.ExportDeclared);
|
||||
Assert.AreEqual(9001, flagged.Port);
|
||||
foreach (var value in new[] { "true", "sì", "yes" })
|
||||
{
|
||||
Assert.IsTrue(ServerOptions.TryParse([], Env(("FEBE_PASSWORD", "x"), ("FEBE_ESPORTA", value)), out var on, out problem), problem);
|
||||
Assert.IsTrue(on.ExportDeclared, value);
|
||||
}
|
||||
|
||||
foreach (var value in new[] { "0", "no", "/esporta" })
|
||||
{
|
||||
Assert.IsTrue(ServerOptions.TryParse([], Env(("FEBE_PASSWORD", "x"), ("FEBE_ESPORTA", value)), out var off, out problem), problem);
|
||||
Assert.IsFalse(off.ExportDeclared, value);
|
||||
}
|
||||
|
||||
var browser = o.BrowserEnvironment("/dati/home");
|
||||
Assert.AreEqual("Europe/London", browser["TZ"]);
|
||||
Assert.AreEqual("/dati/home", browser["HOME"]);
|
||||
|
||||
Reference in new issue
Block a user