Files
Playa/tests/Volcanic.AgenticCore.Telegram.Tests/DockerComposeTests.cs
EugeneTes 7bb41f0b5b fix(docker): address review findings
Entrypoint drops the capability bounding set and sets no_new_privs. Security docs
and spec no longer claim the agent can't reach the secrets; docker exec fallbacks
use a clean environment. PLAYWRIGHT_ENABLED drops the nested compose default.
Tests pin the Dockerfile's Playwright install step and the compose model fallback.
2026-09-27 12:34:58 +02:00

28 lines
1.2 KiB
C#

using System.Text.RegularExpressions;
namespace Volcanic.AgenticCore.Telegram.Tests;
/// <summary>Values the repo-root <c>docker-compose.yml</c> copies from the host's code.</summary>
public sealed class DockerComposeTests
{
[Fact]
public void Compose_model_fallback_matches_TelegramOptions_DefaultModel()
{
var compose = File.ReadAllText(RepoFile("docker-compose.yml"));
var matches = Regex.Matches(compose, @"Telegram__Model=\$\{TELEGRAM_MODEL:-(?<model>[^}]+)\}");
var match = Assert.Single(matches);
Assert.Equal(TelegramOptions.DefaultModel, match.Groups["model"].Value);
}
/// <summary>A file in the repository root, found by walking up from the test output to <c>VolcanicAgenticCore.slnx</c>.</summary>
private static string RepoFile(string name)
{
for (var dir = new DirectoryInfo(AppContext.BaseDirectory); dir is not null; dir = dir.Parent)
{
if (File.Exists(Path.Combine(dir.FullName, "VolcanicAgenticCore.slnx"))) return Path.Combine(dir.FullName, name);
}
throw new InvalidOperationException("VolcanicAgenticCore.slnx not found above " + AppContext.BaseDirectory);
}
}