Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,20 @@ jobs:
dotnet tool install --global Microsoft.Playwright.CLI
export PATH="$PATH:$HOME/.dotnet/tools"

- name: Run unit tests
# Pure-unit-tests project. Runs BEFORE Docker boot because it
# doesn't need the BTCPay test stack - completes in ~1s. Keeps
# the unit-test feedback loop fast even when the integration
# test below takes minutes.
run: dotnet test SamRockProtocol.UnitTests --logger "console;verbosity=normal" /p:EnableBoltzSupport=false

- name: Start Docker containers
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
run: docker compose -f "submodules/btcpayserver/BTCPayServer.Tests/docker-compose.yml" up -d dev --build

- name: Run tests
- name: Run integration tests
run: dotnet test SamRockProtocol.Tests --logger "console;verbosity=detailed" /p:EnableBoltzSupport=false

- name: Cleanup Docker
Expand Down
1 change: 0 additions & 1 deletion SamRockProtocol.Tests/SamRockProtocol.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<ProjectReference Include="..\submodules\btcpayserver\BTCPayServer.Tests\BTCPayServer.Tests.csproj">
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
<ProjectReference Include="..\Plugins\SamRockProtocol\SamRockProtocol.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using SamRockProtocol.Services;
using Xunit;

namespace BTCPayServer.Plugins.Tests;
namespace SamRockProtocol.UnitTests;

/// <summary>
/// Pure unit tests for SamRockProtocol's descriptor parsing helpers. No DI,
Expand Down
45 changes: 45 additions & 0 deletions SamRockProtocol.UnitTests/SamRockProtocol.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<StaticWebAssetsEnabled>false</StaticWebAssetsEnabled>
<RootNamespace>SamRockProtocol.UnitTests</RootNamespace>
</PropertyGroup>

<ItemDefinitionGroup>
<ProjectReference>
<Properties>StaticWebAssetsEnabled=false</Properties>
</ProjectReference>
</ItemDefinitionGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<!--
Deliberately references ONLY the SamRockProtocol plugin project, NOT
the BTCPayServer test fixtures. The integration-test project
(SamRockProtocol.Tests) must stay disentangled from any compile-time
reference to plugin-internal types, because BTCPay's PluginManager
scans AppDomain.CurrentDomain.GetAssemblies() before its file-based
PluginLoader path and dedup-locks out anything already in AppDomain
(PluginManager.cs:155-256). A plugin loaded that way registers with
Loader=null and skips mvcBuilder.AddPluginLoader, so its controller
routes 404 on the integration test. Keeping the pure unit tests in
their own assembly lets us cover DescriptorParser without poisoning
the integration test.
-->
<ItemGroup>
<ProjectReference Include="..\Plugins\SamRockProtocol\SamRockProtocol.csproj" />
</ItemGroup>

</Project>
14 changes: 14 additions & 0 deletions SamRockProtocol.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AResources", "AResources",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamRockProtocol.Tests", "SamRockProtocol.Tests\SamRockProtocol.Tests.csproj", "{E70B0FF3-63AD-4812-83D2-C83FDC2D95E3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamRockProtocol.UnitTests", "SamRockProtocol.UnitTests\SamRockProtocol.UnitTests.csproj", "{9968594F-24FD-4AD0-86F5-E747D10BD468}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -189,6 +191,18 @@ Global
{E70B0FF3-63AD-4812-83D2-C83FDC2D95E3}.Release|x64.Build.0 = Release|Any CPU
{E70B0FF3-63AD-4812-83D2-C83FDC2D95E3}.Release|x86.ActiveCfg = Release|Any CPU
{E70B0FF3-63AD-4812-83D2-C83FDC2D95E3}.Release|x86.Build.0 = Release|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Debug|x64.ActiveCfg = Debug|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Debug|x64.Build.0 = Debug|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Debug|x86.ActiveCfg = Debug|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Debug|x86.Build.0 = Debug|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Release|Any CPU.Build.0 = Release|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Release|x64.ActiveCfg = Release|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Release|x64.Build.0 = Release|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Release|x86.ActiveCfg = Release|Any CPU
{9968594F-24FD-4AD0-86F5-E747D10BD468}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading