Skip to content

Commit 806452c

Browse files
authored
Merge pull request #24 from evolvedbinary/fail-build-on-fail-intergration
Fail build on fail intergration
2 parents e58d179 + 5aabf74 commit 806452c

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,19 @@
258258
<version>3.0.0-M5</version>
259259
<executions>
260260
<execution>
261+
<id>run-integration-tests</id>
262+
<phase>integration-test</phase>
261263
<goals>
262264
<goal>integration-test</goal>
263265
</goals>
264266
</execution>
267+
<execution>
268+
<id>verify-integration-tests-result</id>
269+
<phase>verify</phase>
270+
<goals>
271+
<goal>verify</goal>
272+
</goals>
273+
</execution>
265274
</executions>
266275
</plugin>
267276

src/test/java/com/fusiondb/studio/api/API.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public class API {
6161
*/
6262
public static String ENV_VAR_FS_API_PORT = "FS_API_PORT";
6363

64+
private static String ENV_VAR_DOCKER_TEST_IMAGE = "DOCKER_TEST_IMAGE";
65+
6466
/**
6567
* Get the Base URI for the Fusion Studio API.
6668
*
@@ -141,6 +143,7 @@ static <K, V> Map<K, V> mapOf(final Tuple2<K, V>... entries) {
141143
return map;
142144
}
143145

146+
144147
static <K, V> Map<K, V>[] arrayOf(final Map<K, V>... entries) {
145148
if (entries == null) {
146149
return new Map[0];
@@ -152,4 +155,15 @@ static <K, V> Map<K, V>[] arrayOf(final Map<K, V>... entries) {
152155
}
153156
return arrayOfMaps;
154157
}
158+
159+
static boolean testServerHasBadJsonSerialization() {
160+
final String dockerTestImage = envVarOrDefault(ENV_VAR_DOCKER_TEST_IMAGE, null, envVarValue -> envVarValue);
161+
if (dockerTestImage == null || dockerTestImage.isEmpty()) {
162+
return false;
163+
}
164+
165+
return dockerTestImage.endsWith("fusiondb-server:1.0.0-ALPHA2")
166+
|| dockerTestImage.endsWith("existdb:5.0.0")
167+
|| dockerTestImage.endsWith("existdb:5.2.0");
168+
}
155169
}

src/test/java/com/fusiondb/studio/api/QueryIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
package com.fusiondb.studio.api;
1919

20+
import org.junit.jupiter.api.Assumptions;
2021
import org.junit.jupiter.api.BeforeAll;
2122
import org.junit.jupiter.api.Test;
2223

@@ -256,6 +257,8 @@ public void serializeQueryAsAdaptive() {
256257

257258
@Test
258259
public void serializeQueryAsJsonNoIndent() {
260+
Assumptions.assumeFalse(testServerHasBadJsonSerialization());
261+
259262
final Map<String, Object> requestBody = mapOf(
260263
Tuple("query", "map {'a': 'b', 'x': ['y', 'z'], 't': true(), 'f': false() }"),
261264
Tuple("defaultSerialization", mapOf(
@@ -278,6 +281,8 @@ public void serializeQueryAsJsonNoIndent() {
278281

279282
@Test
280283
public void serializeQueryAsJsonIndent() {
284+
Assumptions.assumeFalse(testServerHasBadJsonSerialization());
285+
281286
final Map<String, Object> requestBody = mapOf(
282287
Tuple("query", "map {'a': 'b', 'x': ['y', 'z'], 't': true(), 'f': false() }"),
283288
Tuple("defaultSerialization", mapOf(

0 commit comments

Comments
 (0)