gazbert / bxbot

A simple Bitcoin trading bot written in Java.
MIT License
779 stars 275 forks source link

Failed tests #89

Closed neopium closed 6 years ago

neopium commented 6 years ago

Hi, I tried on both the HEAD and the 0.8.6 release and have the same error messages while running the command:

./mvnw clean assembly:assembly

[ERROR] Failures: 
[ERROR]   TestBitfinexExchangeAdapter.testCreateOrderToBuyIsSuccessful:168 
  Unexpected method call Map.put("amount", "0.03"):
[ERROR]   TestBitfinexExchangeAdapter.testCreateOrderToSellIsSuccessful:204 
  Unexpected method call Map.put("amount", "0.03"):
[ERROR]   TestBitfinexExchangeAdapter.testSendingAuthenticatedRequestToExchangeSuccessfully:1003 
  Unexpected method call HashMap.put("amount", "0.03"):
[ERROR]   TestBitstampExchangeAdapter.testCreateOrderToBuyIsSuccessful:245 
  Unexpected method call Map.put("price", "200.18"):
[ERROR]   TestBitstampExchangeAdapter.testCreateOrderToSellIsSuccessful:279 
  Unexpected method call Map.put("price", "300.18"):
[ERROR]   TestBitstampExchangeAdapter.testSendingAuthenticatedRequestToExchangeSuccessfully:1002 
  Unexpected method call HashMap.put("price", "300.18"):
[ERROR]   TestGdaxExchangeAdapter.testCreateOrderToBuyIsSuccessful:170 
  Unexpected method call Map.put("price", "200.18"):
[ERROR]   TestGdaxExchangeAdapter.testCreateOrderToSellIsSuccessful:204 
  Unexpected method call Map.put("price", "300.18"):
[ERROR]   TestGdaxExchangeAdapter.testSendingAuthenticatedRequestToExchangeSuccessfully:946 
  Unexpected method call GdaxExchangeAdapter.makeNetworkRequest(https://api.gdax.com/orders, "POST", "{"side":"sell","size":"0.01","price":"300.18","product_id":"BTC-GBP"}", {}):
    GdaxExchangeAdapter.makeNetworkRequest(https://api.gdax.com/orders, "POST", "{"side":"sell","size":"0,01","price":"300,18","product_id":"BTC-GBP"}", {}): expected: 1, actual: 0
[ERROR]   TestGeminiExchangeAdapter.testCreateOrderToBuyIsSuccessful:254 
  Unexpected method call Map.put("amount", "0.001"):
[ERROR]   TestGeminiExchangeAdapter.testCreateOrderToSellIsSuccessful:289 
  Unexpected method call Map.put("amount", "0.002"):
[ERROR]   TestGeminiExchangeAdapter.testSendingAuthenticatedRequestToExchangeSuccessfully:827 
  Unexpected method call HashMap.put("amount", "0.002"):
[ERROR]   TestHuobiExchangeAdapter.testCreateOrderToBuyIsSuccessful:180 
  Unexpected method call Map.put("price", "200.18"):
[ERROR]   TestHuobiExchangeAdapter.testCreateOrderToSellIsSuccessful:213 
  Unexpected method call Map.put("price", "300.18"):
[ERROR]   TestHuobiExchangeAdapter.testSendingAuthenticatedRequestToExchangeSuccessfully:990 
  Unexpected method call HashMap.put("price", "300.18"):
[ERROR]   TestItBitExchangeAdapter.testCreateOrderToBuyIsSuccessful:179 
  Unexpected method call Map.put("amount", "0.01"):
[ERROR]   TestItBitExchangeAdapter.testCreateOrderToSellIsSuccessful:217 
  Unexpected method call Map.put("amount", "0.0005"):
[ERROR]   TestItBitExchangeAdapter.testSendingAuthenticatedRequestToExchangeSuccessfully:958 
  Unexpected method call HashMap.put("amount", "0.0005"):
[ERROR]   TestKrakenExchangeAdapter.testCreateOrderToBuyIsSuccessful:397 
  Unexpected method call Map.put("price", "456.41"):
[ERROR]   TestKrakenExchangeAdapter.testCreateOrderToSellIsSuccessful:432 
  Unexpected method call Map.put("price", "758.17"):
[ERROR]   TestKrakenExchangeAdapter.testSendingAuthenticatedRequestToExchangeSuccessfully:1095 
  Unexpected method call HashMap.put("price", "758.17"):
[ERROR]   TestOkcoinExchangeAdapter.testCreateOrderToBuyIsSuccessful:266 
  Unexpected method call Map.put("price", "200.18"):
[ERROR]   TestOkcoinExchangeAdapter.testCreateOrderToSellIsSuccessful:300 
  Unexpected method call Map.put("price", "300.176"):
[ERROR]   TestOkcoinExchangeAdapter.testSendingAuthenticatedRequestToExchangeSuccessfully:1075 
  Unexpected method call HashMap.put("price", "300.176"):
[ERROR] Errors: 
[ERROR]   TestBitfinexExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesExchangeNetworkException » 
[ERROR]   TestBitfinexExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesTradingApiException » 
[ERROR]   TestBitstampExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesExchangeNetworkException » 
[ERROR]   TestBitstampExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesTradingApiException » 
[ERROR]   TestGdaxExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesExchangeNetworkException » 
[ERROR]   TestGdaxExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesTradingApiException » 
[ERROR]   TestGeminiExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesExchangeNetworkException » 
[ERROR]   TestGeminiExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesTradingApiException » 
[ERROR]   TestHuobiExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesExchangeNetworkException » 
[ERROR]   TestHuobiExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesTradingApiException » 
[ERROR]   TestItBitExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesExchangeNetworkException » 
[ERROR]   TestItBitExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesTradingApiException » 
[ERROR]   TestKrakenExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesExchangeNetworkException » 
[ERROR]   TestKrakenExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesTradingApiException » 
[ERROR]   TestOkcoinExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesExchangeNetworkException » 
[ERROR]   TestOkcoinExchangeAdapter.testSendingAuthenticatedRequestToExchangeHandlesTradingApiException » 
[INFO] 
[ERROR] Tests run: 321, Failures: 24, Errors: 16, Skipped: 0

Here is my mvn -version information:

Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 17:22:22+0200)
Maven home: /usr/local/apache-maven
Java version: 1.8.0_65, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre
Default locale: fr_FR, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"
gazbert commented 6 years ago

What do see when you type:

./mvnw -version

Are you sure you are running the maven wrapper? Where did you run the build from? The project root?

Your system is using a very old version of maven 3.1. according to your maven -verison output. The bot needs maven 3.2.1 to build.

Does the Gradle build work for you?

The build ran on Travis last night and my machine just now, so this has to be environmental...

aterjung commented 6 years ago

Hi, im expecting exact the same failed tests. I have tested the gradle build with the same errors. This is my maven -version output:

Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00) Maven home: /opt/local/share/java/maven32 Java version: 1.8.0_60, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre Default locale: de_DE, platform encoding: UTF-8 OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"

What is obvious to me is the same old OSX Version 10.11.6. Help would be nice, i would like to start playing with the bot!

aterjung commented 6 years ago

anything i can do to solve this issue? I have no idea where to start...

gazbert commented 6 years ago

Hi guys, not sure what's going on here. I've just run a build with head of master successfully on my mac. Maven output:

mybox:~/dev/IdeaProjects/bxbot$ ./mvnw -v Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T08:58:13+01:00) Maven home: /Users/me/.m2/wrapper/dists/apache-maven-3.5.2-bin/28qa8v9e2mq69covern8vmdkj0/apache-maven-3.5.2 Java version: 1.8.0_152, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre Default locale: en_GB, platform encoding: UTF-8 OS name: "mac os x", version: "10.13.3", arch: "x86_64", family: "mac"

Gradle build also works.

For now, you can disable the unit tests by using:

./mvnw assembly:assembly -Dmaven.test.skip=true

@aterjung - have you tried building using Gradle?

@neopium and @aterjung - could you both attach the full output from the maven build and I'll investigate.

-gazbert

aterjung commented 6 years ago

Hi, yes, i have tried maven and gradle bulids.

I have attached the maven output as file.

thanks in advance mavenbuild.txt

gazbert commented 6 years ago

I think I've found the issue.

The tests assume that the locale will always default to using a . for the decimal symbol. You guys are running French and German locale settings which default to a , for the decimal symbol.

https://docs.oracle.com/cd/E19455-01/806-0169/overview-9/index.html

The exchanges always expect a . as the decmial symbol, so I've overriden locale settings to use it.

Let me know if the head of master branch builds for you now.

gazbert commented 6 years ago

Released.