Skip to content

Commit

Permalink
Updated unit tests and CI configuration (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcarrere authored Nov 29, 2024
1 parent cec475f commit 03b8e23
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/unit_tests_windows-2022.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: unit_tests_windows-2022

on:
push:
branches:
- "**"
pull_request:
branches:
- "**"

workflow_dispatch:

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3

- name: Setup .NET 9
uses: actions/setup-dotnet@v3
with:
dotnet-version: 9.0.x

#- name: Install MAUI Workload
# run: dotnet workload install maui


- name: Restore Dependencies
run: dotnet restore LM-Kit-Maestro.sln

- name: Test
run: dotnet test tests/LM-Kit-Maestro.Tests.csproj --verbosity normal

4 changes: 2 additions & 2 deletions LM-Kit-Maestro/LM-Kit-Maestro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="LM-Kit.NET" Version="2024.11.9" />
<PackageReference Include="LM-Kit.NET.Backend.Cuda12.Windows" Version="2024.11.9" />
<PackageReference Include="LM-Kit.NET" Version="2024.11.10" />
<PackageReference Include="LM-Kit.NET.Backend.Cuda12.Windows" Version="2024.11.10" />
<PackageReference Include="Majorsoft.Blazor.Components.Common.JsInterop" Version="1.5.0" />
<PackageReference Include="Markdig" Version="0.38.0" />
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.10" />
Expand Down
12 changes: 11 additions & 1 deletion tests/Services/DummyLLmFileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ internal class DummyLLmFileManager : ILLMFileManager
public ObservableCollection<Uri> UnsortedModels { get; } = new ObservableCollection<Uri>();

public bool FileCollectingInProgress { get; private set; }
public string ModelsFolderPath { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public string ModelsFolderPath
{
get
{
return "";
}
set
{

}
}

#pragma warning disable 67
public event EventHandler? FileCollectingCompleted;
Expand Down
2 changes: 1 addition & 1 deletion tests/Services/LMKitMaestroTestsHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static byte[] GetTestChatHistoryData()
{
var assembly = Assembly.GetExecutingAssembly();

using (Stream chatHistoryStream = assembly!.GetManifestResourceStream("MaestroTests.ChatHistorySerialized.txt")!)
using (Stream chatHistoryStream = assembly!.GetManifestResourceStream("Maestro.Tests.ChatHistorySerialized.txt")!)
using (StreamReader reader = new(chatHistoryStream))
{
string result = reader.ReadToEnd();
Expand Down
4 changes: 2 additions & 2 deletions tests/Services/LMKitMaestroTestsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace LMKit.Maestro.Tests
{
internal class MaestroTestsService
{
public static readonly Uri Model1 = new(@"https://huggingface.co/lm-kit/phi-3.1-mini-4k-3.8b-instruct-gguf/resolve/main/Phi-3.1-mini-4k-Instruct-Q3_K_M.gguf?download=true");
public static readonly Uri Model2 = new(@"https://huggingface.co/lm-kit/llama-3-8b-instruct-gguf/resolve/main/Llama-3-8B-Instruct-Q4_K_M.gguf?download=true");
public static readonly Uri Model1 = new(@"https://huggingface.co/lm-kit/llama-3.2-1b-instruct.gguf/resolve/main/Llama-3.2-1B-Instruct-Q4_K_M.gguf?download=true");
public static readonly Uri Model2 = new(@"https://huggingface.co/lm-kit/qwen-2.5-0.5b-instruct-gguf/resolve/main/Qwen-2.5-0.5B-Instruct-Q4_K_M.gguf?download=true");

private Exception? _errorLoadingException;
TaskCompletionSource<bool>? _modelLoadingTask;
Expand Down

0 comments on commit 03b8e23

Please sign in to comment.