From 6a5c0658c16e54b75c6f91caac3aabac87801ed7 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 28 Mar 2024 12:15:14 +0100 Subject: [PATCH] Test on both 2.3.10 and 2.4.o-rc.1 in CI --- .github/workflows/Build.yml | 6 +++--- Milvus.Client.Tests/MilvusFixture.cs | 14 +++++++++++++- Version.props | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 4ba3267..0c97bb2 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -12,9 +12,7 @@ jobs: strategy: matrix: - # TODO: Test against latest previews too. This currently doesn't work because preview releases don't publish - # a milvus-standalone-docker-compose.yml - milvus_version: [v2.3.10] + milvus_version: [v2.3.10, v2.4.0-rc.1] steps: - name: Checkout @@ -28,6 +26,8 @@ jobs: - name: Test run: dotnet test --logger "GitHubActions;report-warnings=false" + env: + MILVUS_IMAGE: milvusdb/milvus:${{ matrix.milvus_version }} - name: Pack run: dotnet pack -c Release -o Artifacts diff --git a/Milvus.Client.Tests/MilvusFixture.cs b/Milvus.Client.Tests/MilvusFixture.cs index b2ebebb..04b18aa 100644 --- a/Milvus.Client.Tests/MilvusFixture.cs +++ b/Milvus.Client.Tests/MilvusFixture.cs @@ -8,7 +8,19 @@ public sealed class MilvusTestCollection : ICollectionFixture; public sealed class MilvusFixture : IAsyncLifetime { - private readonly MilvusContainer _container = new MilvusBuilder().Build(); + private readonly MilvusContainer _container; + + public MilvusFixture() + { + var milvusBuilder = new MilvusBuilder(); + + if (Environment.GetEnvironmentVariable("MILVUS_IMAGE") is string milvusImage) + { + milvusBuilder = milvusBuilder.WithImage(milvusImage); + } + + _container = milvusBuilder.Build(); + } public string Host => _container.Hostname; public int Port => _container.GetMappedPublicPort(MilvusBuilder.MilvusGrpcPort); diff --git a/Version.props b/Version.props index a8fd0af..5b989cb 100644 --- a/Version.props +++ b/Version.props @@ -1,5 +1,5 @@ - 2.3.0 + 2.4.0