39 instantiations of DashboardRunDescriptor
Aspire.Dashboard (1)
ServiceClient\DashboardRunStore.cs (1)
599return new DashboardRunDescriptor(
Aspire.Dashboard.Components.Tests (37)
Layout\MainLayoutResourceTerminalsTests.cs (2)
64new("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true), 65new("historical", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, DateTimeOffset.UnixEpoch, true, "TestApp", string.Empty, false)
Layout\MainLayoutTerminalTests.cs (2)
97new("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, true), 98new("historical", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, DateTimeOffset.UnixEpoch, true, "TestApp", string.Empty, false)
Layout\MainLayoutTests.cs (32)
317var historicalRun = new DashboardRunDescriptor( 328new( 365var incompatibleRun = new DashboardRunDescriptor( 374var currentRun = new DashboardRunDescriptor( 383var unavailableRun = new DashboardRunDescriptor( 435new( 469var historicalRun = new DashboardRunDescriptor( 480new( 676new( 685new( 738var currentRun = new DashboardRunDescriptor( 747var historicalRun = new DashboardRunDescriptor( 792var currentRun = new DashboardRunDescriptor("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true); 793var pinnedRunB = new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 794var pinnedRunA = new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 795var olderPinnedRun = new DashboardRunDescriptor("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 796var unpinnedRun = new DashboardRunDescriptor("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false); 797var incompatibleRun = new DashboardRunDescriptor("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 798var unavailableRun = new DashboardRunDescriptor("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 799var prunedRun = new DashboardRunDescriptor("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true }; 821var currentRun = new DashboardRunDescriptor( 832new DashboardRunDescriptor("unpinned-b", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 12, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false), 833new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 11, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false), 834new DashboardRunDescriptor("unpinned-a", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 9, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false), 835new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, new(2025, 1, 2, 10, 0, 0, TimeSpan.Zero), null, true, "TestApp", string.Empty, IsCurrent: false) 916new( 960var historicalRun = new DashboardRunDescriptor( 971new( 1014new( 1023new( 1073var historicalRun = new DashboardRunDescriptor( 1084new(
Shared\FluentUISetupHelpers.cs (1)
271new(
Aspire.Dashboard.Tests (1)
Shared\TestDashboardDataSource.cs (1)
47[new("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", databasePath ?? string.Empty, IsCurrent: true)])
97 references to DashboardRunDescriptor
Aspire.Dashboard (40)
Components\Controls\DashboardRunSelect.razor.cs (9)
59foreach (var run in runs) 102internal static List<DashboardRunDescriptor> GetSortedRuns(IReadOnlyList<DashboardRunDescriptor> storedRuns) 104var runs = new List<DashboardRunDescriptor>(storedRuns.Count); 105foreach (var run in storedRuns) 117private static int CompareRuns(DashboardRunDescriptor left, DashboardRunDescriptor right) 136private void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 148private string FormatRunOption(DashboardRunDescriptor run)
ServiceClient\DashboardDataSource.cs (9)
16DashboardRunDescriptor SelectedRun { get; } 54internal DashboardRunDescriptor SelectedRun { get; private set; } = null!; 76DashboardRunDescriptor IDashboardRunSelection.SelectedRun => SelectedRun; 82var currentRun = _runStore.GetCurrentRun(); 83var selectedRun = runId is not null ? _runStore.GetRunById(runId, onlyCompatible: true) : null; 99var previousRun = SelectedRun; 150private void SelectCurrentRun(DashboardRunDescriptor currentRun) 159private void LogRunSwitch(DashboardRunDescriptor? previousRun, DashboardRunDescriptor selectedRun)
ServiceClient\DashboardDataSourcePool.cs (2)
49var currentRun = _runStore.GetCurrentRun(); 74public Lease? TryAcquire(DashboardRunDescriptor run)
ServiceClient\DashboardRunStore.cs (20)
30IReadOnlyList<DashboardRunDescriptor> GetRuns(); 36DashboardRunDescriptor GetCurrentRun(); 44DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible); 51void SetRunPinned(DashboardRunDescriptor run, bool isPinned); 58IDisposable? TryAcquireRunLease(DashboardRunDescriptor run); 94private readonly Lazy<IReadOnlyList<DashboardRunDescriptor>> _runs; 293public IReadOnlyList<DashboardRunDescriptor> GetRuns() => 296public DashboardRunDescriptor GetCurrentRun() => GetRuns().Single(run => run.IsCurrent); 298public DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible) => 303public void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 305var storedRun = GetRunById(run.RunId, onlyCompatible: false); 324private void UpdatePinnedState(DashboardRunDescriptor run, string runDirectory, bool isPinned) 374public IDisposable? TryAcquireRunLease(DashboardRunDescriptor run) 376var storedRun = GetRunById(run.RunId, onlyCompatible: true); 396private IReadOnlyList<DashboardRunDescriptor> LoadRuns() 398var runs = new List<DashboardRunDescriptor> 425var run = CreateDescriptor(metadata, directory, isCurrent: false); 517foreach (var run in _runs.Value.Where(run => !run.IsPinned).Skip(MaxRuns)) 597private static DashboardRunDescriptor CreateDescriptor(DashboardRunMetadata metadata, string runDirectory, bool isCurrent) 667private sealed class RunLease(DashboardRunStore owner, DashboardRunDescriptor run, FileLock runLock) : IDisposable
Aspire.Dashboard.Components.Tests (28)
Layout\MainLayoutTests.cs (19)
317var historicalRun = new DashboardRunDescriptor( 365var incompatibleRun = new DashboardRunDescriptor( 374var currentRun = new DashboardRunDescriptor( 383var unavailableRun = new DashboardRunDescriptor( 469var historicalRun = new DashboardRunDescriptor( 592var currentRun = runStore.GetRuns().Single(run => run.IsCurrent); 738var currentRun = new DashboardRunDescriptor( 747var historicalRun = new DashboardRunDescriptor( 792var currentRun = new DashboardRunDescriptor("current", DashboardRunStore.SchemaVersion, DateTimeOffset.UnixEpoch, null, false, "TestApp", string.Empty, IsCurrent: true); 793var pinnedRunB = new DashboardRunDescriptor("pinned-b", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 794var pinnedRunA = new DashboardRunDescriptor("pinned-a", DashboardRunStore.SchemaVersion, startedAtUtc, null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 795var olderPinnedRun = new DashboardRunDescriptor("pinned-older", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(-1), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPinned = true }; 796var unpinnedRun = new DashboardRunDescriptor("unpinned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(1), null, true, "TestApp", string.Empty, IsCurrent: false); 797var incompatibleRun = new DashboardRunDescriptor("incompatible", DashboardRunStore.SchemaVersion - 1, startedAtUtc.AddDays(2), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 798var unavailableRun = new DashboardRunDescriptor("unavailable", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(3), null, true, "TestApp", string.Empty, IsCurrent: false) { IsSelectable = false }; 799var prunedRun = new DashboardRunDescriptor("pruned", DashboardRunStore.SchemaVersion, startedAtUtc.AddDays(4), null, true, "TestApp", string.Empty, IsCurrent: false) { IsPruned = true }; 821var currentRun = new DashboardRunDescriptor( 960var historicalRun = new DashboardRunDescriptor( 1073var historicalRun = new DashboardRunDescriptor(
Shared\FluentUISetupHelpers.cs (9)
265IEnumerable<DashboardRunDescriptor>? runs = null, 269private readonly IReadOnlyList<DashboardRunDescriptor> _runs = (runs ?? 284public Action<DashboardRunDescriptor, bool>? OnSetRunPinned { get; set; } 286public IReadOnlyList<DashboardRunDescriptor> GetRuns() 292public DashboardRunDescriptor GetCurrentRun() => _runs.Single(run => run.IsCurrent); 294public DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible) => 300public void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 306public IDisposable? TryAcquireRunLease(DashboardRunDescriptor run) => null; 321public DashboardRunDescriptor SelectedRun { get; private set; } = runStore.GetCurrentRun();
Aspire.Dashboard.Tests (29)
Integration\StartupTests.cs (1)
115var currentRun = app.Services.GetRequiredService<IDashboardRunStore>().GetRuns().Single(run => run.IsCurrent);
Model\DashboardDataSourceTests.cs (20)
250var currentRun = Assert.Single(currentRunStore.GetRuns()); 262var historicalRun = nextRunStore.GetRuns().Single(run => string.Equals(run.RunId, pinnedRunId, StringComparison.Ordinal)); 767var incompatibleRun = Assert.Single( 811var futureRun = Assert.Single( 855var incompatibleRun = Assert.Single( 885var currentRun = runStore.GetCurrentRun(); 916var activeRun = Assert.Single(runs, run => string.Equals(run.RunId, activeRunStore.RunId, StringComparison.Ordinal)); 1006var prunedRun = Assert.Single(runsBeforePruning, run => run.IsPruned); 1036var run = pinningRunStore.GetRuns().Single(run => string.Equals(run.RunId, runId, StringComparison.Ordinal)); 1156var historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal)); 1206var historicalRun = currentRunStore.GetRuns().Single(run => string.Equals(run.RunId, historicalRunId, StringComparison.Ordinal)); 1277var currentRun = Assert.Single(currentRunStore.GetRuns(), run => run.IsCurrent); 1278var malformedRun = currentRun with 1327var currentRun = Assert.Single(currentRunStore.GetRuns()); 1328var historicalRun = currentRun with 1334var malformedRun = currentRun with 1340var unavailableRun = currentRun with 1540var currentRun = Assert.Single(currentRunStore.GetRuns()); 1541var incompatibleRun = currentRun with 1677private static FileStream? TryOpenTestRunLease(DashboardRunDescriptor run)
Shared\TestDashboardDataSource.cs (8)
42IEnumerable<DashboardRunDescriptor>? runs = null, 43Func<DashboardRunDescriptor, IDisposable?>? tryAcquireRunLease = null, 46private readonly IReadOnlyList<DashboardRunDescriptor> _runs = (runs ?? 52public IReadOnlyList<DashboardRunDescriptor> GetRuns() => _runs; 54public DashboardRunDescriptor GetCurrentRun() => _runs.Single(run => run.IsCurrent); 56public DashboardRunDescriptor? GetRunById(string runId, bool onlyCompatible) => 62public void SetRunPinned(DashboardRunDescriptor run, bool isPinned) 67public IDisposable? TryAcquireRunLease(DashboardRunDescriptor run) => tryAcquireRunLease?.Invoke(run);