Files
jRay/Jellyfin.Plugin.JRay.Tests/Jellyfin.Plugin.JRay.Tests.csproj
dtourolleandClaude Opus 5 2926740d03
🏗️ Build Plugin / build (push) Successful in 29s
Latest Release / latest-release (push) Successful in 39s
🧪 Test Plugin / test (push) Successful in 26s
JR-023: correct the missing-dependency logs, and test them
Both failure paths still told admins the overlay was "falling back to patching
index.html on disk". JR-021 deleted that fallback, so the message was false --
and it was false in the worst place, since an admin reads it precisely when
debugging a missing overlay and would go hunting for a patch that no longer
exists. They now name the install URL and say the overlay is disabled while
every other feature is unaffected. The not-found case is a Warning, not
Information: a headline feature being off should not sit among startup chatter.

UT-012..015 cover the branch. The File Transformation assembly is genuinely
absent from the test host, so TryRegister exercises its real not-found path
rather than a seam invented for the test. UT-015 pins that a null payload
returns empty rather than throwing -- this callback runs inside another
plugin's request path on every page served, so throwing would break the web
client itself, not just JRay's overlay.

Making those runnable needed the test project to reference Jellyfin.Controller
and Jellyfin.Model without the plugin's ExcludeAssets=runtime. My earlier claim
that DisableTransitiveFrameworkReferences alone sufficed was too narrow: it
drops the demand for the web *framework*, but ILogger and MediaBrowser.Common
live in the excluded assets, so anything past dependency-free logic failed at
run time with FileNotFoundException. Both settings are needed, and the register
now says so.

Second mutation check: downgrading the warning to Information fails UT-013 and
nothing else. Source restored and re-verified.

JR-023 reaches Done for the detection half. The config-page banner stays T4 --
verifiable only against a live server.

TRACES: UT-012, UT-013, UT-014, UT-015 | JR-023

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 09:18:40 +02:00

57 lines
2.5 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<!--
The plugin project treats warnings as errors and runs StyleCop. Tests do
not inherit that: their naming conventions differ deliberately (Method_
Condition_Expectation reads as documentation, and trips SA1300-family
rules), and a style failure in a test is not a defect in the thing under
test.
-->
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<!--
The plugin targets net9.0 to match Jellyfin's ABI, but a machine that can
build it need not have the 9.0 *runtime* installed. Roll the test host
forward to whatever major is present so the suite runs on a developer box
and on CI without pinning either to a runtime that is not the plugin's.
-->
<RollForward>LatestMajor</RollForward>
<!--
The plugin framework-references Microsoft.AspNetCore.App through
Jellyfin.Controller, and that reference flows into anything referencing
the plugin. The T1 tier tests pure logic that touches no web type, so
inheriting the web framework would make the suite unrunnable on any box
without the ASP.NET Core runtime for no benefit. .NET resolves assemblies
lazily, so types that never touch ASP.NET load fine without it.
T2 (controllers, authorisation) genuinely needs that runtime. When those
tests arrive they belong in a second project that keeps this reference.
-->
<DisableTransitiveFrameworkReferences>true</DisableTransitiveFrameworkReferences>
</PropertyGroup>
<ItemGroup>
<!--
The plugin sets ExcludeAssets=runtime on these: at run time the Jellyfin
server supplies them, so shipping copies in the plugin would risk loading
a second, different MediaBrowser.Common. The test host is not the server,
so it has to bring its own — hence the same packages without that
exclusion, and only here.
-->
<PackageReference Include="Jellyfin.Controller" Version="10.11.5" />
<PackageReference Include="Jellyfin.Model" Version="10.11.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Jellyfin.Plugin.JRay\Jellyfin.Plugin.JRay.csproj" />
</ItemGroup>
</Project>