Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests against LDK bindings #2

Merged
merged 1 commit into from Mar 10, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/CI.yml
Expand Up @@ -60,6 +60,19 @@ jobs:
with:
name: snap
path: ./*.snap

integration_tests:
strategy:
matrix:
# macos-13 is x64 and macos-14 is arm64
os: [ubuntu-22.04, macos-13, macos-14]

needs: build
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- name: Run Tests
run: dotnet test

run_snap:
needs: build_snap
Expand Down
6 changes: 6 additions & 0 deletions Directory.Packages.props
Expand Up @@ -4,5 +4,11 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="FSharp.Data" Version="6.3.0" />
<PackageVersion Include="org.ldk" Version="0.0.121.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageVersion Include="NUnit.Analyzers" Version="3.6.1" />
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions PackWallet.sln
@@ -1,7 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PackWallet", "src\PackWallet\PackWallet.fsproj", "{23AE2DF5-6284-404B-A583-05A02539B0DF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackWallet.Tests.Integration", "src\PackWallet.Tests.Integration\PackWallet.Tests.Integration.csproj", "{0A88324C-3B50-4851-A67F-FA084BDC6148}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -12,5 +15,9 @@ Global
{23AE2DF5-6284-404B-A583-05A02539B0DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23AE2DF5-6284-404B-A583-05A02539B0DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23AE2DF5-6284-404B-A583-05A02539B0DF}.Release|Any CPU.Build.0 = Release|Any CPU
{0A88324C-3B50-4851-A67F-FA084BDC6148}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A88324C-3B50-4851-A67F-FA084BDC6148}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A88324C-3B50-4851-A67F-FA084BDC6148}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A88324C-3B50-4851-A67F-FA084BDC6148}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
25 changes: 25 additions & 0 deletions src/PackWallet.Tests.Integration/LdkInterop.cs
@@ -0,0 +1,25 @@
namespace PackWallet.Tests.Integration;

using org.ldk.structs;

class ConsoleLogger : LoggerInterface
{
public void log(Record record)
{
// just don't throw
}
}

public class LdkInterop
{
[SetUp]
public void Setup()
{
}

[Test]
public void TestLoggerDoesntCrash()
{
Logger.new_impl(new ConsoleLogger());
}
}
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="NUnit.Analyzers" />
<PackageReference Include="coverlet.collector" />
<PackageReference Include="org.ldk" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/PackWallet.Tests.Integration/Usings.cs
@@ -0,0 +1 @@
global using NUnit.Framework;