8 instantiations of DashboardRunStore
Aspire.Dashboard.Tests (8)
Model\DashboardDataSourceTests.cs (8)
220
using var runStore = new
DashboardRunStore
(
387
using var runStore = new
DashboardRunStore
(
414
using var secondRunStore = new
DashboardRunStore
(options, logger, TimeProvider.System);
459
using var secondRunStore = new
DashboardRunStore
(options, logger, TimeProvider.System);
827
using var pruningRunStore = new
DashboardRunStore
(
838
using var nextPruningRunStore = new
DashboardRunStore
(
947
using var currentRunStore = new
DashboardRunStore
(
1330
return new
DashboardRunStore
(options, NullLogger<DashboardRunStore>.Instance, timeProvider ?? TimeProvider.System);
148 references to DashboardRunStore
Aspire.Dashboard (9)
DashboardWebApplication.cs (2)
325
builder.Services.AddSingleton<
DashboardRunStore
>();
326
builder.Services.AddSingleton<IDashboardRunStore>(services => services.GetRequiredService<
DashboardRunStore
>());
Model\DashboardSqliteOutgoingPeerResolver.cs (3)
14
var isDashboardSqlite = string.Equals(attributes.GetValue(OtlpSpan.PeerServiceAttributeKey),
DashboardRunStore
.DatabaseFileName, StringComparison.Ordinal) &&
16
string.Equals(attributes.GetValue("db.namespace"),
DashboardRunStore
.DatabaseFileName, StringComparison.Ordinal);
18
name = isDashboardSqlite ?
DashboardRunStore
.DatabaseFileName : null;
ServiceClient\DashboardRunStore.cs (4)
85
private readonly ILogger<
DashboardRunStore
> _logger;
92
public DashboardRunStore(IOptions<DashboardOptions> options, ILogger<
DashboardRunStore
> logger, TimeProvider timeProvider)
99
ILogger<
DashboardRunStore
> logger,
614
private sealed class RunLease(
DashboardRunStore
owner, DashboardRunDescriptor run, FileLock runLock) : IDisposable
Aspire.Dashboard.Components.Tests (22)
Layout\MainLayoutTests.cs (21)
277
SchemaVersion:
DashboardRunStore
.SchemaVersion,
288
SchemaVersion:
DashboardRunStore
.SchemaVersion,
323
SchemaVersion:
DashboardRunStore
.SchemaVersion,
357
SchemaVersion:
DashboardRunStore
.SchemaVersion,
368
SchemaVersion:
DashboardRunStore
.SchemaVersion,
535
SchemaVersion:
DashboardRunStore
.SchemaVersion,
544
SchemaVersion:
DashboardRunStore
.SchemaVersion,
597
SchemaVersion:
DashboardRunStore
.SchemaVersion,
606
SchemaVersion:
DashboardRunStore
.SchemaVersion,
650
SchemaVersion:
DashboardRunStore
.SchemaVersion,
659
new DashboardRunDescriptor("unpinned-b",
DashboardRunStore
.SchemaVersion, new(2025, 1, 2, 12, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false),
660
new DashboardRunDescriptor("pinned-b",
DashboardRunStore
.SchemaVersion, new(2025, 1, 2, 11, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false),
661
new DashboardRunDescriptor("unpinned-a",
DashboardRunStore
.SchemaVersion, new(2025, 1, 2, 9, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false),
662
new DashboardRunDescriptor("pinned-a",
DashboardRunStore
.SchemaVersion, new(2025, 1, 2, 10, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false)
713
SchemaVersion:
DashboardRunStore
.SchemaVersion,
757
SchemaVersion:
DashboardRunStore
.SchemaVersion,
768
SchemaVersion:
DashboardRunStore
.SchemaVersion,
811
SchemaVersion:
DashboardRunStore
.SchemaVersion,
820
SchemaVersion:
DashboardRunStore
.SchemaVersion,
870
SchemaVersion:
DashboardRunStore
.SchemaVersion,
881
SchemaVersion:
DashboardRunStore
.SchemaVersion,
Shared\FluentUISetupHelpers.cs (1)
268
SchemaVersion:
DashboardRunStore
.SchemaVersion,
Aspire.Dashboard.Tests (117)
Integration\StartupTests.cs (1)
1072
var runsDirectory =
DashboardRunStore
.GetRunsDirectory(workspace.Path);
Model\DashboardDataSourceTests.cs (115)
35
using
var
runStore = CreateRunStore(options);
37
var applicationDirectoryName =
DashboardRunStore
.GetApplicationDirectoryName("My Dashboard");
50
using
var
runStore = CreateRunStore(options);
52
var applicationDirectoryName =
DashboardRunStore
.GetApplicationDirectoryName("My Dashboard");
61
var applicationDirectoryName =
DashboardRunStore
.GetApplicationDirectoryName("My Dashboard");
68
Assert.Equal(expectedDirectory,
DashboardRunStore
.GetApplicationDirectory(dataRoot: null, "My Dashboard"));
83
? [
DashboardRunStore
.GetRunsDirectory(workspace.Path)]
86
DashboardRunStore
.GetResumesDirectory(workspace.Path),
87
DashboardRunStore
.GetApplicationDirectory(workspace.Path, "My Dashboard")
99
using
var
runStore = CreateRunStore(CreateOptions(workspace, "My Dashboard", persistenceMode));
115
using
var
runStore = CreateRunStore(CreateOptions(workspace), timeProvider);
127
using
var
firstRunStore = CreateRunStore(options, timeProvider);
139
using
var
runStore = CreateRunStore(options);
158
Assert.Equal(
DashboardRunStore
.SchemaVersion, metadata.RootElement.GetProperty("SchemaVersion").GetInt32());
159
Assert.Equal(
DashboardRunStore
.SchemaVersion, Assert.Single(runStore.GetRuns()).SchemaVersion);
170
using (
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt)))
184
using
var
nextRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMinutes(1)));
195
using
var
runStore = CreateRunStore(options);
220
using
var
runStore = new DashboardRunStore(
222
loggerFactory.CreateLogger<
DashboardRunStore
>(),
253
using (
var
runStore = CreateRunStore(options))
281
.AddSingleton<ILogger<
DashboardRunStore
>>(NullLogger<
DashboardRunStore
>.Instance)
285
.AddSingleton<
DashboardRunStore
>()
286
.AddSingleton<IDashboardRunStore>(serviceProvider => serviceProvider.GetRequiredService<
DashboardRunStore
>())
295
var
runStore = serviceProvider.GetRequiredService<
DashboardRunStore
>();
330
using
var
runStore = CreateRunStore(CreateOptions(workspace, persistenceMode: DashboardPersistenceMode.None));
348
using
var
activeRunStore = CreateRunStore(options);
352
using
var
secondRunStore = CreateRunStore(options);
367
using
var
runStore = CreateRunStore(CreateOptions(workspace, persistenceMode: DashboardPersistenceMode.None));
385
var logger = new TestLogger<
DashboardRunStore
>(new TestLoggerFactory(testSink, enabled: true));
387
using
var
runStore = new DashboardRunStore(
405
using (
var
firstRunStore = CreateRunStore(options))
413
var logger = new TestLogger<
DashboardRunStore
>(new TestLoggerFactory(testSink, enabled: true));
414
using
var
secondRunStore = new DashboardRunStore(options, logger, TimeProvider.System);
431
using
var
firstRunStore = CreateRunStore(options);
447
using (
var
firstRunStore = CreateRunStore(options))
458
var logger = new TestLogger<
DashboardRunStore
>(new TestLoggerFactory(testSink, enabled: true));
459
using
var
secondRunStore = new DashboardRunStore(options, logger, TimeProvider.System);
465
write => write.Message == $"Existing dashboard database at '{databasePath}' is incompatible with schema version {
DashboardRunStore
.SchemaVersion} and will be replaced.");
479
using (
var
firstRunStore = CreateRunStore(options))
522
var firstDirectoryName =
DashboardRunStore
.GetApplicationDirectoryName(firstName);
523
var secondDirectoryName =
DashboardRunStore
.GetApplicationDirectoryName(secondName);
525
Assert.Equal(
DashboardRunStore
.MaxApplicationDirectoryNameLength, firstDirectoryName.Length);
526
Assert.Equal(
DashboardRunStore
.MaxApplicationDirectoryNameLength, secondDirectoryName.Length);
530
Assert.Equal(firstDirectoryName,
DashboardRunStore
.GetApplicationDirectoryName(firstName));
540
using (
var
historicalRunStore = CreateRunStore(options))
547
using
var
currentRunStore = CreateRunStore(options);
572
using (
var
otherApplicationRunStore = CreateRunStore(
580
using (
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMilliseconds(1))))
585
using
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMilliseconds(2)));
597
using
var
runStore = CreateRunStore(CreateOptions(workspace));
609
using
var
runStore = CreateRunStore(CreateOptions(workspace));
625
using (
var
historicalRunStore = CreateRunStore(options))
632
using
var
activeRunStore = CreateRunStore(options);
635
using
var
currentRunStore = CreateRunStore(options);
661
foreach (var index in Enumerable.Range(1,
DashboardRunStore
.MaxRuns))
663
using
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(-index)));
668
using
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt));
672
Assert.Equal(
DashboardRunStore
.MaxRuns, Directory.GetDirectories(runsDirectory).Length);
686
foreach (var index in Enumerable.Range(0,
DashboardRunStore
.MaxRuns - activeRunCount))
688
using
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMilliseconds(index)));
692
var activeRunStores = new List<
DashboardRunStore
>();
693
foreach (var index in Enumerable.Range(
DashboardRunStore
.MaxRuns - activeRunCount, activeRunCount))
695
var
activeRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMilliseconds(index)));
702
using
var
currentRunStore = CreateRunStore(
704
new FixedTimeProvider(startedAt.AddMilliseconds(
DashboardRunStore
.MaxRuns)));
709
foreach (
var
activeRunStore in activeRunStores)
718
Assert.Equal(
DashboardRunStore
.MaxRuns - activeRunCount, selectableRuns.Count);
735
using (
var
runStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(runIndex++))))
741
using
var
pinningRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(runIndex++)));
752
for (var index = 0; index <
DashboardRunStore
.MaxRuns - 1; index++)
754
using
var
runStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(runIndex++)));
758
using
var
finalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(runIndex)));
766
Assert.Equal(
DashboardRunStore
.MaxRuns - 1, runs.Count(run => !run.IsCurrent && !run.IsPinned));
778
foreach (var index in Enumerable.Range(1,
DashboardRunStore
.MaxRuns - 1))
780
using
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(-index)));
784
using
var
activeRunStore = CreateRunStore(
786
new FixedTimeProvider(startedAt.AddDays(-
DashboardRunStore
.MaxRuns)));
789
using
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt));
794
Assert.Equal(
DashboardRunStore
.MaxRuns + 1, Directory.GetDirectories(runsDirectory).Length);
806
using (
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt)))
814
using
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddMilliseconds(1)));
820
foreach (var index in Enumerable.Range(1,
DashboardRunStore
.MaxRuns - 2))
822
using
var
additionalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(index)));
827
using
var
pruningRunStore = new DashboardRunStore(
829
NullLogger<
DashboardRunStore
>.Instance,
838
using
var
nextPruningRunStore = new DashboardRunStore(
840
NullLogger<
DashboardRunStore
>.Instance,
855
using (
var
historicalRunStore = CreateRunStore(options))
862
using
var
currentRunStore = CreateRunStore(options);
905
using (
var
historicalRunStore = CreateRunStore(options))
912
using
var
currentRunStore = CreateRunStore(options);
935
foreach (var index in Enumerable.Range(1,
DashboardRunStore
.MaxRuns))
937
using
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(startedAt.AddDays(-index)));
944
var logger = loggerFactory.CreateLogger<
DashboardRunStore
>();
947
using
var
currentRunStore = new DashboardRunStore(
956
Assert.Equal(typeof(
DashboardRunStore
).FullName, warning.LoggerName);
971
using (
var
malformedRunStore = CreateRunStore(options))
983
using
var
currentRunStore = CreateRunStore(options);
1015
using
var
currentRunStore = CreateRunStore(options);
1018
var historicalDatabasePath = Path.Combine(historicalDirectory,
DashboardRunStore
.DatabaseFileName);
1024
var malformedDatabasePath = Path.Combine(malformedDirectory,
DashboardRunStore
.DatabaseFileName);
1050
DatabasePath = Path.Combine(workspace.Path, "unavailable",
DashboardRunStore
.DatabaseFileName),
1117
using (
var
historicalRunStore = CreateRunStore(options))
1147
using
var
currentRunStore = CreateRunStore(options);
1225
using
var
currentRunStore = CreateRunStore(options);
1248
using (
var
historicalRunStore = CreateRunStore(options, new FixedTimeProvider(historicalRunTime)))
1253
using
var
currentRunStore = CreateRunStore(options, new FixedTimeProvider(historicalRunTime.AddMilliseconds(1)));
1302
private static async Task InitializeAndPublishRunAsync(
DashboardRunStore
runStore)
1311
private static async Task InitializeAndPublishRunWithoutPruningAsync(
DashboardRunStore
runStore)
1328
private static
DashboardRunStore
CreateRunStore(IOptions<DashboardOptions> options, TimeProvider? timeProvider = null)
1330
return new DashboardRunStore(options, NullLogger<
DashboardRunStore
>.Instance, timeProvider ?? TimeProvider.System);
1351
DashboardRunStore
.GetRunLockPath(runDirectory),
Shared\TestDashboardDataSource.cs (1)
47
[new("current",
DashboardRunStore
.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", databasePath ?? string.Empty, IsCurrent: true)])