service: fix backtest test for binance restrict

This commit is contained in:
c9s 2022-12-03 11:02:36 +08:00
parent 3fc65122b6
commit 26e221cf7e
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -3,6 +3,8 @@ package service
import ( import (
"context" "context"
"database/sql" "database/sql"
"os"
"strconv"
"testing" "testing"
"time" "time"
@ -15,6 +17,10 @@ import (
) )
func TestBacktestService_FindMissingTimeRanges_EmptyData(t *testing.T) { func TestBacktestService_FindMissingTimeRanges_EmptyData(t *testing.T) {
if b, _ := strconv.ParseBool(os.Getenv("CI")); b {
t.Skip("skip test for CI")
}
db, err := prepareDB(t) db, err := prepareDB(t)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -40,6 +46,10 @@ func TestBacktestService_FindMissingTimeRanges_EmptyData(t *testing.T) {
} }
func TestBacktestService_QueryExistingDataRange(t *testing.T) { func TestBacktestService_QueryExistingDataRange(t *testing.T) {
if b, _ := strconv.ParseBool(os.Getenv("CI")); b {
t.Skip("skip test for CI")
}
db, err := prepareDB(t) db, err := prepareDB(t)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -67,6 +77,10 @@ func TestBacktestService_QueryExistingDataRange(t *testing.T) {
} }
func TestBacktestService_SyncPartial(t *testing.T) { func TestBacktestService_SyncPartial(t *testing.T) {
if b, _ := strconv.ParseBool(os.Getenv("CI")); b {
t.Skip("skip test for CI")
}
db, err := prepareDB(t) db, err := prepareDB(t)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -113,6 +127,10 @@ func TestBacktestService_SyncPartial(t *testing.T) {
} }
func TestBacktestService_FindMissingTimeRanges(t *testing.T) { func TestBacktestService_FindMissingTimeRanges(t *testing.T) {
if b, _ := strconv.ParseBool(os.Getenv("CI")); b {
t.Skip("skip test for CI")
}
db, err := prepareDB(t) db, err := prepareDB(t)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)