diff --git a/.circleci/config.yml b/.circleci/config.yml index 7318a4fa8..5d96d7f15 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,12 +36,6 @@ commands: paths: - "/go/src/github.com/stellar/kelp/vendor" - test_kelp: - steps: - - run: - name: Run Kelp tests - command: go test --short -ldflags="-X github.com/stellar/kelp/cmd.version=test_compile -X github.com/stellar/kelp/cmd.guiVersion=test_compile -X github.com/stellar/kelp/cmd.gitBranch=test_compile -X github.com/stellar/kelp/cmd.gitHash=test_compile -X github.com/stellar/kelp/cmd.buildDate=test_compile -X github.com/stellar/kelp/cmd.env=dev" ./... - build_kelp: steps: - run: @@ -55,6 +49,37 @@ commands: name: Ensure build was successful command: ./bin/kelp version + test_kelp: + steps: + - run: + name: Run Kelp tests + command: go test --short -ldflags="-X github.com/stellar/kelp/cmd.version=test_compile -X github.com/stellar/kelp/cmd.guiVersion=test_compile -X github.com/stellar/kelp/cmd.gitBranch=test_compile -X github.com/stellar/kelp/cmd.gitHash=test_compile -X github.com/stellar/kelp/cmd.buildDate=test_compile -X github.com/stellar/kelp/cmd.env=dev" ./... + + test_kelp__integration_delete: + steps: + - run: + name: Run Kelp tests integration - delete + command: ./bin/kelp trade -c examples/configs/trader/sample_trader.cfg -s delete --iter 1 + + test_kelp__integration_buysell: + steps: + - run: + name: Run Kelp tests integration - buysell + command: ./bin/kelp trade -c examples/configs/trader/sample_trader.cfg -s buysell -f examples/configs/trader/sample_buysell.cfg --iter 1 + + test_kelp__integration_balanced: + steps: + - run: + name: Run Kelp tests integration - balanced + command: ./bin/kelp trade -c examples/configs/trader/sample_trader.cfg -s balanced -f examples/configs/trader/sample_balanced.cfg --iter 1 + + test_kelp__integration_mirror: + steps: + - run: + name: Run Kelp tests integration - mirror + command: ./bin/kelp trade -c examples/configs/trader/sample_trader.cfg -s mirror -f examples/configs/trader/sample_mirror.cfg --iter 1 + + jobs: # test performs all package tests from Kelp test_1_13: @@ -66,14 +91,30 @@ jobs: - image: circleci/postgres:12.1-alpine-ram environment: POSTGRES_USER: postgres - steps: - install_deps - build_kelp - test_kelp + + # test runs all the strategies as integration tests, one after the other so there's no interference + test_1_13__integration: + working_directory: /go/src/github.com/stellar/kelp + docker: + - image: circleci/golang:1.13 + steps: + # limit to only the key strategies because of rate limit issues, remaining strategies: sell, sell_twap, pendulum + - install_deps + - build_kelp + # delete once before we start our set of tests, don't delete in between tests because of rate limit issues + - test_kelp__integration_delete + - test_kelp__integration_buysell + - test_kelp__integration_balanced + # run mirror last because it produces many offers + - test_kelp__integration_mirror workflows: version: 2 build-and-test: jobs: - test_1_13 + - test_1_13__integration diff --git a/examples/configs/trader/sample_trader.cfg b/examples/configs/trader/sample_trader.cfg index dbe132a49..9cb589167 100644 --- a/examples/configs/trader/sample_trader.cfg +++ b/examples/configs/trader/sample_trader.cfg @@ -41,7 +41,7 @@ DELETE_CYCLES_THRESHOLD=0 # Note: in most cases you are probably better off tracking fills at the beginning of the update cycle only (by setting SYNCHRONIZE_STATE_LOAD_ENABLE to true) # although there is a valid use case to still want to track fills every X milliseconds in addition to using the new config, for example when you want a # faster response to trades, such as with the mirror strategy. -FILL_TRACKER_SLEEP_MILLIS=0 +FILL_TRACKER_SLEEP_MILLIS=150000 # how many continuous errors in each fill-tracking cycle can the bot accept before it will delete all offers to protect its exposure. # this number has to be exceeded for all the offers to be deleted and any error will be counted only once per cycle. # any time the bot completes a full run successfully this counter will be reset.