Path: redb-route/tests/Shared/TestStand.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/Shared/TestStand.cs
----
namespace redb.Route.Tests.Shared;
///
/// The test stand of docker-compose.tests.yml: its keys and shared folders are written by
/// tests/docker/gen-certs.sh into tests/docker/.generated (git-ignored). Found by walking up from the
/// test's bin folder, so it works in this repository and in the published redb-route tree alike.
///
internal static class TestStand
{
///
/// tests/docker/.generated/<subfolder>, or, when no stand folder is found above the bin folder, that
/// relative path itself (the test then reports the missing files, which names what to run).
///
public static string Generated(string subfolder)
{
for (var dir = new DirectoryInfo(AppContext.BaseDirectory); dir is not null; dir = dir.Parent)
{
var docker = Path.Combine(dir.FullName, "tests", "docker");
if (File.Exists(Path.Combine(docker, "gen-certs.sh")))
return Path.Combine(docker, ".generated", subfolder);
}
return Path.Combine("tests", "docker", ".generated", subfolder);
}
/// The command that starts a profile of the stand, for skip and failure texts.
public static string Up(string profile)
=> $"docker compose -f redb.Route/docker-compose.tests.yml --profile {profile} up -d --wait";
}