test: метка Requires=Windows для STA-диспетчера, CI исключает её
ci / build (push) Successful in 29s
ci / build (push) Successful in 29s
This commit is contained in:
@@ -54,6 +54,11 @@ jobs:
|
||||
- name: build
|
||||
run: dotnet build src/Kompas.Mcp.Host/Kompas.Mcp.Host.csproj -c Release -p:EnableWindowsTargeting=true
|
||||
|
||||
# Интеграционные тесты в CI не выполняются: им нужен запущенный КОМПАС с GUI и лицензией.
|
||||
# Что здесь НЕ выполняется и почему:
|
||||
# Category=Integration — нужен запущенный КОМПАС с GUI и лицензией;
|
||||
# Requires=Windows — КОМПАС не нужен, но нужна Windows (STA-апартамент
|
||||
# в KompasDispatcher: на Linux SetApartmentState бросает
|
||||
# PlatformNotSupportedException).
|
||||
# Оба класса гоняются на машине разработчика, см. CLAUDE.md.
|
||||
- name: unit tests
|
||||
run: dotnet test tests/Kompas.Mcp.Tests/Kompas.Mcp.Tests.csproj --filter "Category=Unit" -c Release -p:EnableWindowsTargeting=true
|
||||
run: dotnet test tests/Kompas.Mcp.Tests/Kompas.Mcp.Tests.csproj --filter "Category=Unit&Requires!=Windows" -c Release -p:EnableWindowsTargeting=true
|
||||
|
||||
@@ -2,8 +2,14 @@ using Kompas.Mcp.Core.Threading;
|
||||
|
||||
namespace Kompas.Mcp.Tests;
|
||||
|
||||
/// <summary>Юнит-тесты STA-диспетчера. COM не требуется.</summary>
|
||||
/// <summary>
|
||||
/// Юнит-тесты STA-диспетчера. Запущенный КОМПАС не нужен, но нужна Windows:
|
||||
/// <c>Thread.SetApartmentState(STA)</c> на Linux бросает
|
||||
/// <c>PlatformNotSupportedException: COM Interop is not supported on this platform</c>.
|
||||
/// Отсюда вторая метка — CI на Linux исключает тесты с <c>Requires=Windows</c>.
|
||||
/// </summary>
|
||||
[Trait("Category", "Unit")]
|
||||
[Trait("Requires", "Windows")]
|
||||
public sealed class DispatcherTests
|
||||
{
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user