Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Add failsafe integration test runner, rename integration tests #540

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,22 @@
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to skip running these entirely on the Travis build - they take a lot of wasted time. Could you add an argument to do that and set the travis build to use it?

<testFailureIgnore>true</testFailureIgnore>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.currency.CurrencyPair;

public class BinanceTest {
public class BinanceIT {

@Test
public void channelCreateUrlTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import info.bitrich.xchangestream.core.StreamingExchange;
import java.math.BigDecimal;
import org.junit.Ignore;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance of changing all those ...Example classes which use main methods to use this pattern too? (Feel free to say "some other time" - it would just be nice to do it all at once).

import org.junit.Test;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.ExchangeSpecification;
Expand All @@ -19,11 +19,10 @@
import org.slf4j.LoggerFactory;

/** @author Nikita Belenkiy on 18/05/2018. */
public class BitmexDeadManSwitchTest {
private static final Logger logger = LoggerFactory.getLogger(BitmexDeadManSwitchTest.class);
public class BitmexDeadManSwitchIT {
private static final Logger logger = LoggerFactory.getLogger(BitmexDeadManSwitchIT.class);

@Test
@Ignore
public void testDeadmanSwitch() throws Exception {
CertHelper.trustAllCerts();
BitmexStreamingExchange exchange =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
import org.slf4j.LoggerFactory;

/** @author Foat Akhmadeev 31/05/2018 */
@Ignore // Requires Bitmex to be up and contactable or the build fails.
public class BitmexTest {
private static final Logger LOG = LoggerFactory.getLogger(BitmexTest.class);
public class BitmexIT {
private static final Logger LOG = LoggerFactory.getLogger(BitmexIT.class);

private static final CurrencyPair xbtUsd = CurrencyPair.XBT_USD;
private static final int MIN_DATA_COUNT = 2;
Expand Down Expand Up @@ -52,7 +51,7 @@ private <T> void awaitDataCount(Observable<T> observable) {
.test()
.assertSubscribed()
.assertNoErrors()
.awaitCount(BitmexTest.MIN_DATA_COUNT)
.awaitCount(BitmexIT.MIN_DATA_COUNT)
.assertNoTimeout()
.dispose();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import info.bitrich.xchangestream.core.StreamingExchange;
import java.math.BigDecimal;
import java.util.List;
import org.junit.Ignore;

import org.junit.Test;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.ExchangeSpecification;
Expand All @@ -22,11 +22,10 @@
import org.slf4j.LoggerFactory;

/** @author Nikita Belenkiy on 18/05/2018. */
public class BitmexOrderReplaceTest {
private static final Logger logger = LoggerFactory.getLogger(BitmexOrderReplaceTest.class);
public class BitmexOrderReplaceIT {
private static final Logger logger = LoggerFactory.getLogger(BitmexOrderReplaceIT.class);

@Test
@Ignore
public void testOrderReplace() throws Exception {
CertHelper.trustAllCerts();
BitmexStreamingExchange exchange =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import org.knowm.xchange.dto.trade.*;
import org.knowm.xchange.lgo.LgoEnv;

@Ignore
public class LgoStreamingExchangeExample {
public class LgoStreamingExchangeIT {

private LgoStreamingExchange exchange;

Expand All @@ -33,7 +32,7 @@ public void setUp() throws Exception {
}

private String readResource(String path) throws IOException {
InputStream stream = LgoStreamingExchangeExample.class.getResourceAsStream(path);
InputStream stream = LgoStreamingExchangeIT.class.getResourceAsStream(path);
return IOUtils.toString(stream, StandardCharsets.UTF_8);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public void it_places_a_limit_order() throws IOException, ParseException {
"abcdefg",
new Date().toInstant().minus(1, ChronoUnit.HOURS),
new Date().toInstant().plus(1, ChronoUnit.HOURS));
InputStream stream = LgoStreamingExchangeExample.class.getResourceAsStream("/public.pem");
InputStream stream = LgoStreamingTradeServiceTest.class.getResourceAsStream("/public.pem");
String utf8 = IOUtils.toString(stream, StandardCharsets.UTF_8);
key.setValue(parsePublicKey(utf8));
when(keyService.selectKey()).thenReturn(key);
Expand Down