Skip to content

Commit 8e09e93

Browse files
committed
Tests wip
1 parent 8cd2387 commit 8e09e93

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/Ydb.Sdk/src/DriverConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class DriverConfig
3232
internal TimeSpan EndpointDiscoveryInterval = TimeSpan.FromMinutes(1);
3333
internal TimeSpan EndpointDiscoveryTimeout = TimeSpan.FromSeconds(10);
3434
internal string SdkVersion { get; }
35+
3536
public DriverConfig(
3637
string endpoint,
3738
string database,
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using Xunit;
2+
using Ydb.Sdk.Services.Query;
3+
using Ydb.Sdk.Tests.Fixture;
4+
5+
namespace Ydb.Sdk.Tests.Sys;
6+
7+
[Trait("Category", "Integration")]
8+
public class QueryLogTests : IClassFixture<QueryClientFixture>
9+
{
10+
private readonly QueryClient _queryClient;
11+
12+
public QueryLogTests(QueryClientFixture queryClientFixture)
13+
{
14+
_queryClient = queryClientFixture.QueryClient;
15+
}
16+
17+
[Fact]
18+
public async Task QueryLogPidCheck()
19+
{
20+
const string sql = @"SELECT * FROM `.sys/query_sessions`";
21+
var expectedPid = Environment.ProcessId.ToString();
22+
23+
await _queryClient.Exec(sql);
24+
var selectAllQueries = await _queryClient.ReadAllRows(sql);
25+
26+
Assert.NotEmpty(selectAllQueries);
27+
Assert.Equal(selectAllQueries[0]["ClientPID"].GetOptionalUtf8(), expectedPid);
28+
}
29+
}

0 commit comments

Comments
 (0)