fix(server): Windows startup test asks for PostgreSQL; TITANO_LOG_LEVEL
The connection-string test built options with the platform default, which is SQLite on Windows, so it parsed a file path as a PostgreSQL connection string. The server gains a log level setting (TITANO_LOG_LEVEL, also in compose and the Unraid template); the test servers log warnings only, which cuts the suite's output from 511 to 80 lines so failures stay findable in CI logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
7 files changed
+22
-4
No files matched your search
@@ -53,7 +53,7 @@ public sealed class AdminTests(TestContext context)
|
||||
[Test]
|
||||
public async Task LogsAreReadableButOnlyByName()
|
||||
{
|
||||
await using var server = await TestServer.StartAsync(context);
|
||||
await using var server = await TestServer.StartAsync(context, o => o.LogLevel = Microsoft.Extensions.Logging.LogLevel.Information);
|
||||
var admin = await server.AdminAsync();
|
||||
using var tail = await admin.GetAsync("/api/v1/logs?lines=20");
|
||||
var lines = await tail.ReadAsync(ProtocolJson.Default.LogTailDto);
|
||||
|
||||
@@ -44,7 +44,15 @@ public sealed class StartupTests(TestContext context)
|
||||
[Test]
|
||||
public void PartsBuildAQuotedPostgresConnectionString()
|
||||
{
|
||||
var options = new ServerOptions { DbHost = "postgres", DbName = "titano", DbUser = "titano", DbPassword = "it's;secret", DbSslMode = "disable" };
|
||||
var options = new ServerOptions
|
||||
{
|
||||
Database = DatabaseKind.Postgres, // the Windows default is SQLite
|
||||
DbHost = "postgres",
|
||||
DbName = "titano",
|
||||
DbUser = "titano",
|
||||
DbPassword = "it's;secret",
|
||||
DbSslMode = "disable",
|
||||
};
|
||||
var settings = Titano.Data.Postgres.PostgresSettings.Parse(options.ToDatabaseOptions().ConnectionString);
|
||||
Assert.Equal(("postgres", "titano", "it's;secret"), (settings.Host, settings.Database, settings.Password));
|
||||
Assert.Equal(Titano.Data.Postgres.SslMode.Disable, settings.SslMode);
|
||||
|
||||
@@ -66,6 +66,8 @@ public sealed class TestServer : IAsyncDisposable
|
||||
AdminPassword = AdminPassword,
|
||||
// Tests sign in many times from one address; the rate-limit test sets the production value.
|
||||
LoginAttemptsPerMinute = 1000,
|
||||
// Info lines of the ~55 servers the suite starts would bury failures in the CI log.
|
||||
LogLevel = Microsoft.Extensions.Logging.LogLevel.Warning,
|
||||
};
|
||||
Directory.CreateDirectory(options.ArchivePath);
|
||||
configure?.Invoke(options);
|
||||
|
||||
Reference in new issue
Block a user