Skip to content

Commit 0abf57f

Browse files
Prepare tests.yaml for EfCore.Ydb (#287)
1 parent 698023b commit 0abf57f

File tree

2 files changed

+23
-28
lines changed

2 files changed

+23
-28
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ jobs:
3030
with:
3131
dotnet-version: ${{ matrix.dotnet-version }}
3232
- name: Test
33-
run: |
34-
cd src
35-
dotnet test --filter "Category=Unit" -f ${{ matrix.dotnet-target-framework }}
33+
run: dotnet test src/Ydb.Sdk/tests/Tests.csproj --filter "Category=Unit" -f ${{ matrix.dotnet-target-framework }}
3634
ado-net-tests:
3735
runs-on: ubuntu-22.04
3836
strategy:
@@ -55,11 +53,6 @@ jobs:
5553
env:
5654
YDB_LOCAL_SURVIVE_RESTART: true
5755
options: '--name ydb-local -h localhost'
58-
env:
59-
OS: ubuntu-22.04
60-
YDB_VERSION: ${{ matrix.ydb-version }}
61-
YDB_CONNECTION_STRING: grpc://localhost:2136/local
62-
YDB_CONNECTION_STRING_SECURE: grpcs://localhost:2135/local
6356
steps:
6457
- name: Checkout code
6558
uses: actions/checkout@v4
@@ -70,8 +63,7 @@ jobs:
7063
- name: Run ADO.NET tests
7164
run: |
7265
docker cp ydb-local:/ydb_certs/ca.pem ~/
73-
cd src
74-
dotnet test --filter "(FullyQualifiedName~Ado) | (FullyQualifiedName~Dapper)" -f ${{ matrix.dotnet-target-framework }} -l "console;verbosity=normal"
66+
dotnet test src/Ydb.Sdk/tests/Tests.csproj --filter "(FullyQualifiedName~Ado) | (FullyQualifiedName~Dapper)" -f ${{ matrix.dotnet-target-framework }} -l "console;verbosity=normal"
7567
topic-tests:
7668
runs-on: ubuntu-22.04
7769
strategy:
@@ -94,11 +86,6 @@ jobs:
9486
env:
9587
YDB_LOCAL_SURVIVE_RESTART: true
9688
options: '--name ydb-local -h localhost'
97-
env:
98-
OS: ubuntu-22.04
99-
YDB_VERSION: ${{ matrix.ydb-version }}
100-
YDB_CONNECTION_STRING: grpc://localhost:2136/local
101-
YDB_CONNECTION_STRING_SECURE: grpcs://localhost:2135/local
10289
steps:
10390
- name: Checkout code
10491
uses: actions/checkout@v4
@@ -107,10 +94,7 @@ jobs:
10794
with:
10895
dotnet-version: ${{ matrix.dotnet-version }}
10996
- name: Run Topic tests
110-
run: |
111-
docker cp ydb-local:/ydb_certs/ca.pem ~/
112-
cd src
113-
dotnet test --filter "FullyQualifiedName~Topic" -f ${{ matrix.dotnet-target-framework }} -l "console;verbosity=detailed"
97+
run: dotnet test src/Ydb.Sdk/tests/Tests.csproj --filter "FullyQualifiedName~Topic" -f ${{ matrix.dotnet-target-framework }} -l "console;verbosity=detailed"
11498
integration-tests:
11599
runs-on: ubuntu-22.04
116100
strategy:
@@ -133,11 +117,6 @@ jobs:
133117
env:
134118
YDB_LOCAL_SURVIVE_RESTART: true
135119
options: '--name ydb-local -h localhost'
136-
env:
137-
OS: ubuntu-22.04
138-
YDB_VERSION: ${{ matrix.ydb-version }}
139-
YDB_CONNECTION_STRING: grpc://localhost:2136/local
140-
YDB_CONNECTION_STRING_SECURE: grpcs://localhost:2135/local
141120
steps:
142121
- name: Checkout code
143122
uses: actions/checkout@v4
@@ -146,10 +125,7 @@ jobs:
146125
with:
147126
dotnet-version: ${{ matrix.dotnet-version }}
148127
- name: Integration test
149-
run: |
150-
docker cp ydb-local:/ydb_certs/ca.pem ~/
151-
cd src
152-
dotnet test --filter "Category=Integration" -f ${{ matrix.dotnet-target-framework }} -l "console;verbosity=normal"
128+
run: dotnet test src/Ydb.Sdk/tests/Tests.csproj --filter "Category=Integration" -f ${{ matrix.dotnet-target-framework }} -l "console;verbosity=normal"
153129

154130
run-examples:
155131
runs-on: ubuntu-22.04

src/Ydb.Sdk/tests/Query/QueryIntegrationTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ INNER JOIN {Tables.Series} AS sr
6464
public async Task ReadRows_UpsertDeleteSelectSingleRow_ReturnNewRow()
6565
{
6666
await _queryClient.Exec($@"
67+
DECLARE $series_id AS Uint64;
68+
DECLARE $season_id AS Uint64;
69+
DECLARE $episode_id AS Uint64;
70+
DECLARE $title AS Text;
71+
DECLARE $air_date AS Date;
72+
6773
UPSERT INTO {Tables.Episodes} (series_id, season_id, episode_id, title, air_date)
6874
VALUES ($series_id, $season_id, $episode_id, $title, $air_date)", new Dictionary<string, YdbValue>
6975
{
@@ -75,6 +81,10 @@ await _queryClient.Exec($@"
7581
});
7682

7783
var row = await _queryClient.ReadRow($@"
84+
DECLARE $series_id AS Uint64;
85+
DECLARE $season_id AS Uint64;
86+
DECLARE $episode_id AS Uint64;
87+
7888
SELECT title FROM {Tables.Episodes}
7989
WHERE series_id = $series_id AND season_id = $season_id AND episode_id = $episode_id;",
8090
new Dictionary<string, YdbValue>
@@ -101,6 +111,10 @@ public async Task DoTx_UpsertThenRollbackTransaction_ReturnOldRow()
101111
await _queryClient.DoTx(async queryTx =>
102112
{
103113
await queryTx.Exec($@"
114+
DECLARE $series_id AS Uint64;
115+
DECLARE $season_id AS Uint64;
116+
DECLARE $air_date AS Date;
117+
104118
UPSERT INTO {Tables.Seasons} (series_id, season_id, first_aired) VALUES
105119
($series_id, $season_id, $air_date);
106120
", new Dictionary<string, YdbValue>
@@ -127,6 +141,10 @@ public async Task DoTx_UpsertThenExceptionInTransaction_ReturnOldRow()
127141
await _queryClient.DoTx(async queryTx =>
128142
{
129143
await queryTx.Exec($@"
144+
DECLARE $series_id AS Uint64;
145+
DECLARE $season_id AS Uint64;
146+
DECLARE $air_date AS Date;
147+
130148
UPSERT INTO {Tables.Seasons} (series_id, season_id, first_aired) VALUES
131149
($series_id, $season_id, $air_date);
132150
", new Dictionary<string, YdbValue>
@@ -204,6 +222,7 @@ public async Task Stream_ReadingMore1000RowsFromChannel_ReturnChannelExecutePart
204222
for (uint i = 0; i < sizeSeasons; i++)
205223
{
206224
tasks[i] = _queryClient.Exec(
225+
$"DECLARE $season_id AS Uint64; DECLARE $title AS Text;" +
207226
$"INSERT INTO {Tables.Seasons} (series_id, season_id, title) VALUES (3, $season_id, $title)",
208227
new Dictionary<string, YdbValue>
209228
{

0 commit comments

Comments
 (0)