From 161e1c189dae1a929a06799caca35dec4d84ce66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Carr=C3=A8re?= Date: Fri, 29 Nov 2024 09:52:30 +0100 Subject: [PATCH 1/4] Updated unit tests and CI configuration --- .github/workflows/unit_tests_windows-2022.yml | 24 +++++++++++++++++++ LM-Kit-Maestro/LM-Kit-Maestro.csproj | 4 ++-- tests/Services/DummyLLmFileManager.cs | 12 +++++++++- tests/Services/LMKitMaestroTestsHelpers.cs | 2 +- tests/Services/LMKitMaestroTestsService.cs | 4 ++-- 5 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/unit_tests_windows-2022.yml diff --git a/.github/workflows/unit_tests_windows-2022.yml b/.github/workflows/unit_tests_windows-2022.yml new file mode 100644 index 00000000..dd21d8ad --- /dev/null +++ b/.github/workflows/unit_tests_windows-2022.yml @@ -0,0 +1,24 @@ +name: unit_tests_windows-2022 + +on: + push: + branches: + - "**" + pull_request: + branches: + - "**" + + workflow_dispatch: + +jobs: + build: + + runs-on: windows-2022 + + steps: + - name: Setup .NET 9 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 9.0.x + - name: Test + run: dotnet test tests/LM-Kit-Maestro.Tests.csproj --verbosity normal diff --git a/LM-Kit-Maestro/LM-Kit-Maestro.csproj b/LM-Kit-Maestro/LM-Kit-Maestro.csproj index aa4847a2..2c482312 100644 --- a/LM-Kit-Maestro/LM-Kit-Maestro.csproj +++ b/LM-Kit-Maestro/LM-Kit-Maestro.csproj @@ -70,8 +70,8 @@ - - + + diff --git a/tests/Services/DummyLLmFileManager.cs b/tests/Services/DummyLLmFileManager.cs index c22b4421..793697ec 100644 --- a/tests/Services/DummyLLmFileManager.cs +++ b/tests/Services/DummyLLmFileManager.cs @@ -10,7 +10,17 @@ internal class DummyLLmFileManager : ILLMFileManager public ObservableCollection UnsortedModels { get; } = new ObservableCollection(); 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; diff --git a/tests/Services/LMKitMaestroTestsHelpers.cs b/tests/Services/LMKitMaestroTestsHelpers.cs index c28cec5c..b1e90400 100644 --- a/tests/Services/LMKitMaestroTestsHelpers.cs +++ b/tests/Services/LMKitMaestroTestsHelpers.cs @@ -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(); diff --git a/tests/Services/LMKitMaestroTestsService.cs b/tests/Services/LMKitMaestroTestsService.cs index 71b8da6e..8b5ad174 100644 --- a/tests/Services/LMKitMaestroTestsService.cs +++ b/tests/Services/LMKitMaestroTestsService.cs @@ -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? _modelLoadingTask; From 2a5ef8484a868b20c12b28d4930b6eac95678f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Carr=C3=A8re?= Date: Fri, 29 Nov 2024 09:56:54 +0100 Subject: [PATCH 2/4] ci update --- .github/workflows/unit_tests_windows-2022.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unit_tests_windows-2022.yml b/.github/workflows/unit_tests_windows-2022.yml index dd21d8ad..0b468773 100644 --- a/.github/workflows/unit_tests_windows-2022.yml +++ b/.github/workflows/unit_tests_windows-2022.yml @@ -20,5 +20,7 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 9.0.x + - name: Restore dependencies + run: dotnet LM-Kit-Maestro.sln - name: Test run: dotnet test tests/LM-Kit-Maestro.Tests.csproj --verbosity normal From 45485dac03cef518311799d071fd094c8bca2306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Carr=C3=A8re?= Date: Fri, 29 Nov 2024 09:58:34 +0100 Subject: [PATCH 3/4] ci update --- .github/workflows/unit_tests_windows-2022.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests_windows-2022.yml b/.github/workflows/unit_tests_windows-2022.yml index 0b468773..b4ef0007 100644 --- a/.github/workflows/unit_tests_windows-2022.yml +++ b/.github/workflows/unit_tests_windows-2022.yml @@ -21,6 +21,6 @@ jobs: with: dotnet-version: 9.0.x - name: Restore dependencies - run: dotnet LM-Kit-Maestro.sln + run: dotnet restore LM-Kit-Maestro.sln - name: Test run: dotnet test tests/LM-Kit-Maestro.Tests.csproj --verbosity normal From 227490f5931f8c3b990d68051f1377e9394b70ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Carr=C3=A8re?= Date: Fri, 29 Nov 2024 10:02:01 +0100 Subject: [PATCH 4/4] ci update --- .github/workflows/unit_tests_windows-2022.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit_tests_windows-2022.yml b/.github/workflows/unit_tests_windows-2022.yml index b4ef0007..6663e672 100644 --- a/.github/workflows/unit_tests_windows-2022.yml +++ b/.github/workflows/unit_tests_windows-2022.yml @@ -11,16 +11,24 @@ on: workflow_dispatch: jobs: - build: - - runs-on: windows-2022 + 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: Restore dependencies - run: dotnet restore LM-Kit-Maestro.sln + + #- 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 +