Skip to content

Commit

Permalink
Huobi: Run WS tests in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Jan 11, 2025
1 parent c2984af commit 58ecd3c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions exchanges/huobi/huobi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,7 @@ func TestQueryWithdrawQuota(t *testing.T) {
}

func TestWSCandles(t *testing.T) {
t.Parallel()
h := new(HUOBI) //nolint:govet // Intentional shadow to avoid future copy/paste mistakes
require.NoError(t, testexch.Setup(h), "Setup Instance must not error")
err := h.Websocket.AddSubscriptions(h.Websocket.Conn, &subscription.Subscription{Key: "market.btcusdt.kline.1min", Asset: asset.Spot, Pairs: currency.Pairs{btcusdtPair}, Channel: subscription.CandlesChannel})
Expand All @@ -1329,6 +1330,7 @@ func TestWSCandles(t *testing.T) {
}

func TestWSOrderbook(t *testing.T) {
t.Parallel()
h := new(HUOBI) //nolint:govet // Intentional shadow to avoid future copy/paste mistakes
require.NoError(t, testexch.Setup(h), "Setup Instance must not error")
err := h.Websocket.AddSubscriptions(h.Websocket.Conn, &subscription.Subscription{Key: "market.btcusdt.depth.step0", Asset: asset.Spot, Pairs: currency.Pairs{btcusdtPair}, Channel: subscription.OrderbookChannel})
Expand Down Expand Up @@ -1357,6 +1359,7 @@ func TestWSOrderbook(t *testing.T) {
// TestWSTradeDetail checks we can send a trade detail through
// We can't currently easily see the result with the current DB instance, so we just check it doesn't error
func TestWSTradeDetail(t *testing.T) {
t.Parallel()
h := new(HUOBI) //nolint:govet // Intentional shadow to avoid future copy/paste mistakes
require.NoError(t, testexch.Setup(h), "Setup Instance must not error")
err := h.Websocket.AddSubscriptions(h.Websocket.Conn, &subscription.Subscription{Key: "market.btcusdt.trade.detail", Asset: asset.Spot, Pairs: currency.Pairs{btcusdtPair}, Channel: subscription.AllTradesChannel})
Expand All @@ -1368,6 +1371,7 @@ func TestWSTradeDetail(t *testing.T) {
}

func TestWSTicker(t *testing.T) {
t.Parallel()
h := new(HUOBI) //nolint:govet // Intentional shadow to avoid future copy/paste mistakes
require.NoError(t, testexch.Setup(h), "Setup Instance must not error")
err := h.Websocket.AddSubscriptions(h.Websocket.Conn, &subscription.Subscription{Key: "market.btcusdt.detail", Asset: asset.Spot, Pairs: currency.Pairs{btcusdtPair}, Channel: subscription.TickerChannel})
Expand Down Expand Up @@ -1396,6 +1400,7 @@ func TestWSTicker(t *testing.T) {
}

func TestWSAccountUpdate(t *testing.T) {
t.Parallel()
h := new(HUOBI) //nolint:govet // Intentional shadow to avoid future copy/paste mistakes
require.NoError(t, testexch.Setup(h), "Setup Instance must not error")
err := h.Websocket.AddSubscriptions(h.Websocket.Conn, &subscription.Subscription{Key: "accounts.update#2", Asset: asset.Spot, Pairs: currency.Pairs{btcusdtPair}, Channel: subscription.MyAccountChannel})
Expand All @@ -1419,6 +1424,7 @@ func TestWSAccountUpdate(t *testing.T) {
}

func TestWSOrderUpdate(t *testing.T) {
t.Parallel()
h := new(HUOBI) //nolint:govet // Intentional shadow to avoid future copy/paste mistakes
require.NoError(t, testexch.Setup(h), "Setup Instance must not error")
err := h.Websocket.AddSubscriptions(h.Websocket.Conn, &subscription.Subscription{Key: "orders#*", Asset: asset.Spot, Pairs: currency.Pairs{btcusdtPair}, Channel: subscription.MyOrdersChannel})
Expand Down Expand Up @@ -1484,6 +1490,7 @@ func TestWSOrderUpdate(t *testing.T) {
}

func TestWSMyTrades(t *testing.T) {
t.Parallel()
h := new(HUOBI) //nolint:govet // Intentional shadow to avoid future copy/paste mistakes
require.NoError(t, testexch.Setup(h), "Setup Instance must not error")
err := h.Websocket.AddSubscriptions(h.Websocket.Conn, &subscription.Subscription{Key: "trade.clearing#btcusdt#1", Asset: asset.Spot, Pairs: currency.Pairs{btcusdtPair}, Channel: subscription.MyTradesChannel})
Expand Down Expand Up @@ -1525,6 +1532,7 @@ func TestWSMyTrades(t *testing.T) {
}

func TestStringToOrderStatus(t *testing.T) {
t.Parallel()
type TestCases struct {
Case string
Result order.Status
Expand All @@ -1545,6 +1553,7 @@ func TestStringToOrderStatus(t *testing.T) {
}

func TestStringToOrderSide(t *testing.T) {
t.Parallel()
type TestCases struct {
Case string
Result order.Side
Expand All @@ -1563,6 +1572,7 @@ func TestStringToOrderSide(t *testing.T) {
}

func TestStringToOrderType(t *testing.T) {
t.Parallel()
type TestCases struct {
Case string
Result order.Type
Expand All @@ -1581,6 +1591,7 @@ func TestStringToOrderType(t *testing.T) {
}

func Test_FormatExchangeKlineInterval(t *testing.T) {
t.Parallel()
for _, tt := range []struct {
interval kline.Interval
output string
Expand Down

0 comments on commit 58ecd3c

Please sign in to comment.