/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Components/WebView/test/StaticWebAssets/RequiresBuiltPackagesAttribute.cs
31 строка
1 KB
Javier Calvarro Nelson
[Blazor] Fix WebView blazor.modules.json publish crash via conditional fallback (#67374) (#67375)
24 июн 2026, 21:43
Не верифицирован
24 июн 2026, 21:43
aa97f5e
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.InternalTesting; namespace Microsoft.AspNetCore.Components.WebView.StaticWebAssets; /// <summary> /// Skips a <see cref="ConditionalFactAttribute"/> test when the required locally-built .nupkg files /// have not been produced (for example on a fresh clone or a CI leg that does not pack), so these /// packaging tests only run where the packages are available. /// </summary> [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)] public sealed class RequiresBuiltPackagesAttribute : Attribute, ITestCondition { private readonly string[] _packageIds; public RequiresBuiltPackagesAttribute(params string[] packageIds) { _packageIds = packageIds; } public bool IsMet => MissingPackages.Count == 0; public string SkipReason => $"Required package(s) were not built: {string.Join(", ", MissingPackages)}. " + $"Pack the projects (e.g. './eng/build.cmd -pack') before running these tests."; private List<string> MissingPackages => _packageIds.Where(id => StaticWebAssetsTestData.TryGetPackagePath(id) is null).ToList(); }