Skip to content

Commit

Permalink
upgraded to testcontainers-redis 1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jruaux committed Jun 14, 2021
1 parent fcd416d commit 7fb5925
Show file tree
Hide file tree
Showing 14 changed files with 183 additions and 94 deletions.
24 changes: 13 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
plugins {
id 'jacoco'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id 'org.jreleaser' version '0.4.0'
id 'com.github.ben-manes.versions' version '0.39.0'
id 'org.asciidoctor.jvm.convert'
id 'org.ajoberstar.git-publish' version '3.0.0'
id 'com.github.ben-manes.versions' version '0.38.0'
id 'org.jreleaser' version '0.2.0'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
}

repositories {
mavenLocal()
mavenCentral()
}

allprojects {
tasks.withType(JavaCompile) {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/redis-developer/registry")
credentials {
username = project.findProperty("github.username") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("github.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}

Expand Down Expand Up @@ -67,6 +68,7 @@ jreleaser {
authors = ['Julien Ruaux']
tags = ['redis']
license = 'Apache-2.0'
copyright = '2021 Julien Ruaux'
java {
multiProject = true
}
Expand Down Expand Up @@ -111,4 +113,4 @@ nexusPublishing {
}
}

gitPublishPush.dependsOn asciidoctor
gitPublishPush.dependsOn asciidoctor
11 changes: 9 additions & 2 deletions buildSrc/src/main/groovy/riot.connector-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ plugins {
}

repositories {
mavenLocal()
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/redis-developer/registry")
credentials {
username = project.findProperty("github.username") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("github.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}

dependencies {
Expand All @@ -15,4 +22,4 @@ dependencies {

tasks.withType(Tar) {
compression = Compression.GZIP
}
}
17 changes: 16 additions & 1 deletion buildSrc/src/main/groovy/riot.java-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@ plugins {
id 'io.spring.dependency-management'
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"

repositories {
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/redis-developer/registry")
credentials {
username = project.findProperty("github.username") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("github.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}

bootJar {
Expand Down Expand Up @@ -42,4 +53,8 @@ configurations.all {

test {
useJUnitPlatform()
}
testLogging {
events "failed"
exceptionFormat "full"
}
}
19 changes: 17 additions & 2 deletions buildSrc/src/main/groovy/riot.publish-conventions.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
plugins {
id 'maven-publish'
id 'signing'
id 'jacoco'
}

repositories {
mavenLocal()
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/redis-developer/registry")
credentials {
username = project.findProperty("github.username") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("github.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}

jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}

java {
Expand Down Expand Up @@ -53,4 +68,4 @@ publishing {

signing {
sign publishing.publications.mavenJava
}
}
12 changes: 12 additions & 0 deletions docs/getting_started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ cd {app}

== Usage

=== Help

[subs="attributes",source,bash]
----
{app} --help
Expand All @@ -48,4 +50,14 @@ You can use `--help` on any subcommand:
----
====

=== Redis Connection

[subs="attributes",source,bash]
----
{app} --help
----

[TIP,subs="attributes"]
====
Redis connection options are the same as `redis-cli`. URI syntax is described https://github.com/lettuce-io/lettuce-core/wiki/Redis-URI-and-connection-details#uri-syntax[here].
====
11 changes: 9 additions & 2 deletions riot-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ plugins {
}

repositories {
mavenLocal()
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/redis-developer/registry")
credentials {
username = project.findProperty("github.username") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("github.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}

dependencies {
Expand All @@ -25,4 +32,4 @@ jar {
manifest {
attributes("Implementation-Title": "RIOT", "Implementation-Version": archiveVersion)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.fasterxml.jackson.databind.ObjectReader;
import com.redislabs.riot.DataType;
import com.redislabs.testcontainers.RedisContainer;
import com.redislabs.testcontainers.RedisServer;
import io.lettuce.core.api.sync.RedisHashCommands;
import io.lettuce.core.api.sync.RedisKeyCommands;
import io.lettuce.core.api.sync.RedisServerCommands;
Expand Down Expand Up @@ -65,7 +66,7 @@ public void clearTables() throws SQLException {

@ParameterizedTest
@MethodSource("containers")
public void testExport(RedisContainer container) throws Exception {
public void testExport(RedisServer container) throws Exception {
Statement statement = connection.createStatement();
statement.execute("CREATE TABLE mytable (id smallint NOT NULL, field1 bpchar, field2 bpchar)");
statement.execute("ALTER TABLE ONLY mytable ADD CONSTRAINT pk_mytable PRIMARY KEY (id)");
Expand All @@ -87,7 +88,7 @@ public void testExport(RedisContainer container) throws Exception {

@ParameterizedTest
@MethodSource("containers")
public void testImport(RedisContainer container) throws Exception {
public void testImport(RedisServer container) throws Exception {
execute("import-postgresql", container, r -> configureImportCommand(r, POSTGRESQL));
Statement statement = connection.createStatement();
statement.execute("SELECT COUNT(*) AS count FROM orders");
Expand All @@ -103,7 +104,7 @@ public void testImport(RedisContainer container) throws Exception {

@ParameterizedTest
@MethodSource("containers")
public void testImportSet(RedisContainer container) throws Exception {
public void testImportSet(RedisServer container) throws Exception {
execute("import-postgresql-set", container, r -> configureImportCommand(r, POSTGRESQL));
Statement statement = connection.createStatement();
statement.execute("SELECT * FROM orders");
Expand Down
Loading

0 comments on commit 7fb5925

Please sign in to comment.