Phase 3C: Deployment pipeline & Store-and-Forward engine
Deployment Manager (WP-1–8, WP-16): - DeploymentService: full pipeline (flatten→validate→send→track→audit) - OperationLockManager: per-instance concurrency control - StateTransitionValidator: Enabled/Disabled/NotDeployed transition matrix - ArtifactDeploymentService: broadcast to all sites with per-site results - Deployment identity (GUID + revision hash), idempotency, staleness detection - Instance lifecycle commands (disable/enable/delete) with deduplication Store-and-Forward (WP-9–15): - StoreAndForwardStorage: SQLite persistence, 3 categories, no max buffer - StoreAndForwardService: fixed-interval retry, transient-only buffering, parking - ReplicationService: async best-effort to standby (fire-and-forget) - Parked message management (query/retry/discard from central) - Messages survive instance deletion, S&F drains on disable 620 tests pass (+79 new), zero warnings.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
namespace ScadaLink.StoreAndForward.Tests;
|
||||
|
||||
/// <summary>
|
||||
/// WP-9: Tests for StoreAndForwardOptions defaults and configuration.
|
||||
/// </summary>
|
||||
public class StoreAndForwardOptionsTests
|
||||
{
|
||||
[Fact]
|
||||
public void DefaultOptions_HasReasonableDefaults()
|
||||
{
|
||||
var options = new StoreAndForwardOptions();
|
||||
|
||||
Assert.Equal("./data/store-and-forward.db", options.SqliteDbPath);
|
||||
Assert.True(options.ReplicationEnabled);
|
||||
Assert.Equal(TimeSpan.FromSeconds(30), options.DefaultRetryInterval);
|
||||
Assert.Equal(50, options.DefaultMaxRetries);
|
||||
Assert.Equal(TimeSpan.FromSeconds(10), options.RetryTimerInterval);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Options_CanBeCustomized()
|
||||
{
|
||||
var options = new StoreAndForwardOptions
|
||||
{
|
||||
SqliteDbPath = "/custom/path.db",
|
||||
ReplicationEnabled = false,
|
||||
DefaultRetryInterval = TimeSpan.FromMinutes(5),
|
||||
DefaultMaxRetries = 100,
|
||||
RetryTimerInterval = TimeSpan.FromSeconds(30)
|
||||
};
|
||||
|
||||
Assert.Equal("/custom/path.db", options.SqliteDbPath);
|
||||
Assert.False(options.ReplicationEnabled);
|
||||
Assert.Equal(TimeSpan.FromMinutes(5), options.DefaultRetryInterval);
|
||||
Assert.Equal(100, options.DefaultMaxRetries);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user