Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ A clear description of the change and why it's being made.
## Which component(s) does this affect?

- [ ] Full Dashboard
- [ ] Lite
- [ ] Lite Dashboard
- [ ] Lite Tests
- [ ] SQL collection scripts
- [ ] Installer
- [ ] CLI Installer
- [ ] GUI Installer
- [ ] Documentation

## How was this tested?
Expand Down
16 changes: 8 additions & 8 deletions Lite.Tests/DuckDbSchemaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public async Task InitializeAsync_CreatesAllTables()
};

using var connection = new DuckDBConnection($"Data Source={_dbPath}");
await connection.OpenAsync();
await connection.OpenAsync(TestContext.Current.CancellationToken);

foreach (var table in expectedTables)
{
using var cmd = connection.CreateCommand();
cmd.CommandText = $"SELECT COUNT(*) FROM information_schema.tables WHERE table_name = '{table}'";
var count = Convert.ToInt32(await cmd.ExecuteScalarAsync());
var count = Convert.ToInt32(await cmd.ExecuteScalarAsync(TestContext.Current.CancellationToken));
Assert.True(count == 1, $"Table '{table}' should exist but was not found");
}
}
Expand All @@ -90,11 +90,11 @@ public async Task InitializeAsync_SetsCorrectSchemaVersion()
await initializer.InitializeAsync();

using var connection = new DuckDBConnection($"Data Source={_dbPath}");
await connection.OpenAsync();
await connection.OpenAsync(TestContext.Current.CancellationToken);

using var cmd = connection.CreateCommand();
cmd.CommandText = "SELECT MAX(version) FROM schema_version";
var version = Convert.ToInt32(await cmd.ExecuteScalarAsync());
var version = Convert.ToInt32(await cmd.ExecuteScalarAsync(TestContext.Current.CancellationToken));

Assert.Equal(DuckDbInitializer.CurrentSchemaVersion, version);
}
Expand All @@ -109,11 +109,11 @@ public async Task InitializeAsync_IsIdempotent()
await initializer.InitializeAsync();

using var connection = new DuckDBConnection($"Data Source={_dbPath}");
await connection.OpenAsync();
await connection.OpenAsync(TestContext.Current.CancellationToken);

using var cmd = connection.CreateCommand();
cmd.CommandText = "SELECT MAX(version) FROM schema_version";
var version = Convert.ToInt32(await cmd.ExecuteScalarAsync());
var version = Convert.ToInt32(await cmd.ExecuteScalarAsync(TestContext.Current.CancellationToken));

Assert.Equal(DuckDbInitializer.CurrentSchemaVersion, version);
}
Expand Down Expand Up @@ -147,12 +147,12 @@ public async Task InitializeAsync_CreatesIndexes()
await initializer.InitializeAsync();

using var connection = new DuckDBConnection($"Data Source={_dbPath}");
await connection.OpenAsync();
await connection.OpenAsync(TestContext.Current.CancellationToken);

/* Verify at least some indexes exist by checking duckdb_indexes */
using var cmd = connection.CreateCommand();
cmd.CommandText = "SELECT COUNT(*) FROM duckdb_indexes()";
var indexCount = Convert.ToInt32(await cmd.ExecuteScalarAsync());
var indexCount = Convert.ToInt32(await cmd.ExecuteScalarAsync(TestContext.Current.CancellationToken));

/* We create 18 indexes */
Assert.True(indexCount >= 18, $"Expected >= 18 indexes, found {indexCount}");
Expand Down
11 changes: 7 additions & 4 deletions Lite.Tests/Lite.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
Expand All @@ -9,9 +9,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.v3" Version="3.2.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading