Skip to content

Commit eab5938

Browse files
committed
Update default YDB container name for integration tests
1 parent b3f3df6 commit eab5938

File tree

6 files changed

+38
-53
lines changed

6 files changed

+38
-53
lines changed

coordination/pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,4 @@
4141
<scope>test</scope>
4242
</dependency>
4343
</dependencies>
44-
45-
<build>
46-
<plugins>
47-
<plugin>
48-
<groupId>org.apache.maven.plugins</groupId>
49-
<artifactId>maven-surefire-plugin</artifactId>
50-
<configuration>
51-
<environmentVariables>
52-
<YDB_DOCKER_IMAGE>cr.yandex/yc/yandex-docker-local-ydb:trunk</YDB_DOCKER_IMAGE>
53-
<TESTCONTAINERS_REUSE_ENABLE>true</TESTCONTAINERS_REUSE_ENABLE>
54-
</environmentVariables>
55-
</configuration>
56-
</plugin>
57-
</plugins>
58-
</build>
5944
</project>

query/pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,4 @@
3636
<scope>test</scope>
3737
</dependency>
3838
</dependencies>
39-
40-
<build>
41-
<plugins>
42-
<plugin>
43-
<groupId>org.apache.maven.plugins</groupId>
44-
<artifactId>maven-surefire-plugin</artifactId>
45-
<configuration>
46-
<environmentVariables>
47-
<YDB_DOCKER_IMAGE>cr.yandex/yc/yandex-docker-local-ydb:trunk</YDB_DOCKER_IMAGE>
48-
<TESTCONTAINERS_REUSE_ENABLE>true</TESTCONTAINERS_REUSE_ENABLE>
49-
</environmentVariables>
50-
</configuration>
51-
</plugin>
52-
</plugins>
53-
</build>
5439
</project>

query/src/test/java/tech/ydb/query/QueryExampleTest.java

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,14 @@ public void step02_upsertTablesData() {
116116
);
117117

118118
// Upsert list of series to table
119-
retryCtx.supplyResult(session -> session.createQuery(
120-
"UPSERT INTO series SELECT * FROM AS_TABLE($values)",
119+
retryCtx.supplyResult(session -> session.createQuery(""
120+
+ "DECLARE $values AS List<Struct<"
121+
+ " series_id: Uint64,"
122+
+ " title: Text,"
123+
+ " release_date: Date,"
124+
+ " series_info: Text"
125+
+ ">>;"
126+
+ "UPSERT INTO series SELECT * FROM AS_TABLE($values)",
121127
TxMode.SERIALIZABLE_RW,
122128
Params.of("$values", seriesData)
123129
).execute()).join().getStatus().expectSuccess("upsert problem");
@@ -143,8 +149,15 @@ public void step02_upsertTablesData() {
143149
);
144150

145151
// Upsert list of seasons to table
146-
retryCtx.supplyResult(session -> session.createQuery(
147-
"UPSERT INTO seasons SELECT * FROM AS_TABLE($values)",
152+
retryCtx.supplyResult(session -> session.createQuery(""
153+
+ "DECLARE $values AS List<Struct<"
154+
+ " series_id: Uint64,"
155+
+ " season_id: Uint64,"
156+
+ " title: Text,"
157+
+ " first_aired: Date,"
158+
+ " last_aired: Date"
159+
+ ">>;"
160+
+ "UPSERT INTO seasons SELECT * FROM AS_TABLE($values)",
148161
TxMode.SERIALIZABLE_RW,
149162
Params.of("$values", seasonsData)
150163
).execute()).join().getStatus().expectSuccess("upsert problem");
@@ -170,8 +183,15 @@ public void step02_upsertTablesData() {
170183
);
171184

172185
// Upsert list of series to episodes
173-
retryCtx.supplyResult(session -> session.createQuery(
174-
"UPSERT INTO episodes SELECT * FROM AS_TABLE($values)",
186+
retryCtx.supplyResult(session -> session.createQuery(""
187+
+ "DECLARE $values AS List<Struct<"
188+
+ " series_id: Uint64,"
189+
+ " season_id: Uint64,"
190+
+ " episode_id: Uint64,"
191+
+ " title: Text,"
192+
+ " air_date: Date"
193+
+ ">>;"
194+
+ "UPSERT INTO episodes SELECT * FROM AS_TABLE($values)",
175195
TxMode.SERIALIZABLE_RW,
176196
Params.of("$values", episodesData)
177197
).execute()).join().getStatus().expectSuccess("upsert problem");

query/src/test/java/tech/ydb/query/impl/QueryIntegrationTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ public void testSimpleCRUD() {
252252

253253
try (QueryClient client = QueryClient.newClient(ydbTransport).build()) {
254254
for (Entity entity: entities) {
255-
String query = "UPSERT INTO `" + TEST_TABLE + "` (id, name, payload, is_valid) "
255+
String query = "DECLARE $id AS Int32;"
256+
+ "DECLARE $name AS Text;"
257+
+ "DECLARE $payload AS Bytes;"
258+
+ "DECLARE $is_valid AS Bool;"
259+
+ "UPSERT INTO `" + TEST_TABLE + "` (id, name, payload, is_valid) "
256260
+ "VALUES ($id, $name, $payload, $is_valid)";
257261

258262
Params params = Params.of(
@@ -459,6 +463,12 @@ public void testMultiStatement() {
459463
try (QueryClient client = QueryClient.newClient(ydbTransport).build()) {
460464
try (QuerySession session = client.createSession(Duration.ofSeconds(5)).join().getValue()) {
461465
String query = ""
466+
+ "DECLARE $s1 AS Int32;"
467+
+ "DECLARE $s2 AS Int32;"
468+
+ "DECLARE $id1 AS Int32;"
469+
+ "DECLARE $id2 AS Int32;"
470+
+ "DECLARE $name1 AS Text;"
471+
+ "DECLARE $name2 AS Text;"
462472
+ "SELECT * FROM `" + TEST_TABLE + "` WHERE id = $s1;"
463473
+ "INSERT INTO `" + TEST_TABLE + "` (id, name) VALUES ($id1, $name1);"
464474
+ "SELECT * FROM `" + TEST_TABLE + "` WHERE id = $s2;"

table/pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,4 @@
4141
<scope>test</scope>
4242
</dependency>
4343
</dependencies>
44-
45-
<build>
46-
<plugins>
47-
<plugin>
48-
<groupId>org.apache.maven.plugins</groupId>
49-
<artifactId>maven-surefire-plugin</artifactId>
50-
<configuration>
51-
<environmentVariables>
52-
<YDB_DOCKER_IMAGE>cr.yandex/yc/yandex-docker-local-ydb:trunk</YDB_DOCKER_IMAGE>
53-
<TESTCONTAINERS_REUSE_ENABLE>true</TESTCONTAINERS_REUSE_ENABLE>
54-
</environmentVariables>
55-
</configuration>
56-
</plugin>
57-
</plugins>
58-
</build>
5944
</project>

tests/common/src/main/java/tech/ydb/test/integration/YdbEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* @author Aleksandr Gorshenin
1010
*/
1111
public class YdbEnvironment {
12-
private static final String YDB_DEFAULT_IMAGE = "cr.yandex/yc/yandex-docker-local-ydb:latest";
12+
private static final String YDB_DEFAULT_IMAGE = "ydbplatform/local-ydb:latest";
1313

1414
private final Supplier<String> ydbEndpoint = createParam("YDB_ENDPOINT", null);
1515
private final Supplier<String> ydbDatabase = createParam("YDB_DATABASE", null);

0 commit comments

Comments
 (0)