Skip to content

Commit

Permalink
Test against Milvus 2.4
Browse files Browse the repository at this point in the history
* Implement CI matrix testing to test on both 2.3.10
  and 2.4.0-rc.1.
  • Loading branch information
roji committed Mar 28, 2024
1 parent 8c025e1 commit 9a5e19a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion Milvus.Client.Tests/CollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,13 @@ public async Task Compact()
});

long compactionId = await collection.CompactAsync();
Assert.NotEqual(0, compactionId);
if ((await Client.GetVersionAsync()).StartsWith("v2.4.", StringComparison.Ordinal))
{
// Milvus 2.4 returns -1 here as the compaction ID
return;
}

Assert.NotEqual(0, compactionId);
await Client.WaitForCompactionAsync(compactionId);

CompactionState state = await Client.GetCompactionStateAsync(compactionId);
Expand Down
6 changes: 5 additions & 1 deletion Milvus.Client.Tests/MilvusFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ public sealed class MilvusTestCollection : ICollectionFixture<MilvusFixture>;

public sealed class MilvusFixture : IAsyncLifetime
{
private readonly MilvusContainer _container = new MilvusBuilder().Build();
private const string DefaultMilvusImage = "milvusdb/milvus:v2.4.0-rc.1";

private readonly MilvusContainer _container = new MilvusBuilder()
.WithImage(Environment.GetEnvironmentVariable("MILVUS_IMAGE") ?? DefaultMilvusImage)
.Build();

public string Host => _container.Hostname;
public int Port => _container.GetMappedPublicPort(MilvusBuilder.MilvusGrpcPort);
Expand Down
2 changes: 1 addition & 1 deletion Version.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>2.3.0</Version>
<Version>2.4.0</Version>
</PropertyGroup>
</Project>

0 comments on commit 9a5e19a

Please sign in to comment.