From 365036f9f27429cb273cf8556089da3d2f3c5fb5 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 4 Mar 2026 23:21:14 -0500 Subject: [PATCH] fix(ci): skip Docker-dependent PostgreSQL tests in upstream test workflow - Add [Trait("Category", "RequiresDocker")] to all 3 PostgreSQL test classes (PostgreSqlMigrationTests, PostgreSqlProviderTests, PostgreSqlConcurrencyTests) - Add --filter "Category!=RequiresDocker" to ci-tests.yml dotnet test command so runners without Docker don't fail on Testcontainers initialization - Disable CodeQL workflow in fork (requires upstream org permissions + .NET 10 CodeQL support that isn't available on our self-hosted runners) PostgreSQL tests still run in ha-build.yml against the cluster where Docker is available via the self-hosted ARC runners. --- .github/workflows/ci-codeql-analysis.yml | 2 ++ .github/workflows/ci-tests.yml | 1 + .../PostgreSqlConcurrencyTests.cs | 1 + .../PostgreSqlMigrationTests.cs | 1 + .../PostgreSqlProviderTests.cs | 1 + 5 files changed, 6 insertions(+) diff --git a/.github/workflows/ci-codeql-analysis.yml b/.github/workflows/ci-codeql-analysis.yml index 5dafab13e..152fa0af2 100644 --- a/.github/workflows/ci-codeql-analysis.yml +++ b/.github/workflows/ci-codeql-analysis.yml @@ -11,6 +11,8 @@ on: jobs: analyze: name: Analyze + # Disabled in fork — upstream CodeQL requires specific GitHub org permissions and .NET 10 support + if: false runs-on: [self-hosted, k3s, linux, amd64] strategy: diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index dc4fe24a5..7d34c8357 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -28,6 +28,7 @@ jobs: --collect:"XPlat Code Coverage" --settings tests/coverletArgs.runsettings --verbosity minimal + --filter "Category!=RequiresDocker" - name: Merge code coverage results uses: danielpalme/ReportGenerator-GitHub-Action@ee0ae774f6d3afedcbd1683c1ab21b83670bdf8e # v5.5.1 diff --git a/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlConcurrencyTests.cs b/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlConcurrencyTests.cs index 1f797bb9b..7b0c64037 100644 --- a/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlConcurrencyTests.cs +++ b/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlConcurrencyTests.cs @@ -18,6 +18,7 @@ namespace Jellyfin.Database.Tests.PostgreSQL; /// /// Integration tests that verify concurrent access patterns against a real PostgreSQL 16 container. /// +[Xunit.Trait("Category", "RequiresDocker")] public sealed class PostgreSqlConcurrencyTests : IAsyncLifetime { private readonly PostgreSqlContainer _container; diff --git a/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlMigrationTests.cs b/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlMigrationTests.cs index e194fdd8d..5a80afe0d 100644 --- a/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlMigrationTests.cs +++ b/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlMigrationTests.cs @@ -15,6 +15,7 @@ namespace Jellyfin.Database.Tests.PostgreSQL; /// /// Integration tests that validate PostgreSQL migrations against a real container. /// +[Xunit.Trait("Category", "RequiresDocker")] public sealed class PostgreSqlMigrationTests : IAsyncLifetime { private readonly PostgreSqlContainer _container; diff --git a/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlProviderTests.cs b/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlProviderTests.cs index b1852735d..9baf7e164 100644 --- a/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlProviderTests.cs +++ b/tests/Jellyfin.Database.Tests.PostgreSQL/PostgreSqlProviderTests.cs @@ -19,6 +19,7 @@ namespace Jellyfin.Database.Tests.PostgreSQL; /// /// Integration tests for CRUD operations, optimisation, and purge against a real PostgreSQL 16 container. /// +[Xunit.Trait("Category", "RequiresDocker")] public sealed class PostgreSqlProviderTests : IAsyncLifetime { private readonly PostgreSqlContainer _container;