-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cicd: Added early-access and release workflows
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
plugins/riot/src/test/java/com/redis/riot/PostgresDeltaTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.redis.riot; | ||
|
||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
import java.sql.Statement; | ||
|
||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.TestInfo; | ||
import org.testcontainers.containers.JdbcDatabaseContainer; | ||
import org.testcontainers.containers.PostgreSQLContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
class PostgresDeltaTests extends DbTests { | ||
|
||
private static final DockerImageName postgresImage = DockerImageName.parse(PostgreSQLContainer.IMAGE) | ||
.withTag(PostgreSQLContainer.DEFAULT_TAG); | ||
private static final PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(postgresImage); | ||
|
||
@Override | ||
protected JdbcDatabaseContainer<?> getJdbcDatabaseContainer() { | ||
return postgres; | ||
} | ||
|
||
@BeforeAll | ||
void setupPostgres() throws SQLException, IOException { | ||
executeScript("db/postgres-delta.sql"); | ||
} | ||
|
||
@Test | ||
void importDelta(TestInfo info) throws Exception { | ||
try (Statement statement = dbConnection.createStatement()) { | ||
for (int index = 0; index < 10; index++) { | ||
statement.execute("INSERT INTO orders (order_date) VALUES (CURRENT_TIMESTAMP - INTERVAL '5 seconds')"); | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DROP TABLE IF EXISTS orders; | ||
|
||
CREATE TABLE orders ( | ||
order_id SERIAL PRIMARY KEY, | ||
order_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|