Skip to content

Coingecko check should be moved out of unit tests #189

@zarazan

Description

@zarazan

Summary

Problem Definition

Unit tests should not hit outside services. This will prevent the required unit tests check from blocking PRs when the coingecko API is not responding.

OR - we should mock the API response in the unit tests and move anything testing the API request to an integration test if we still need it.

Sample failure output:

=== RUN TestCheckProviderMins_Valid
3:59PM WRN Coin gecko found 0 providers for OJO
3:59PM INF providers supporting ATOM: [BingX WhiteBIT Gate.io DigiFinex LBank Binance Phemex BitMart Bitget MEXC XT.COM CITEX Deepcoin P2B Bybit CoinTR Pro Dex-Trade OKX Helix KuCoin PointPay AscendEX (BitMax) Huobi Toobit DIFX Trubit BTCEX QMall CoinEx BtcTurk PRO LATOKEN LocalTrade Coinbase Exchange Bitazza BitStorage FameEX Kraken Poloniex Binance US Bitfinex Bitci TR]
3:59PM INF providers supporting USDT: [Bitfinex Kraken Crypto.com Exchange Coinbase Exchange WhiteBIT BTSE Coinzoom]
--- PASS: TestCheckProviderMins_Valid (1.60s)
=== RUN TestCheckProviderMins_Invalid
3:59PM WRN Coin gecko found 0 providers for OJO
--- PASS: TestCheckProviderMins_Invalid (0.54s)
=== RUN TestProviderWithAPIKey_Valid
3:59PM INF providers supporting ATOM: [BingX WhiteBIT Gate.io DigiFinex LBank Binance Phemex BitMart Bitget MEXC XT.COM CITEX Deepcoin P2B Bybit CoinTR Pro Dex-Trade OKX Helix KuCoin PointPay AscendEX (BitMax) Huobi Toobit DIFX Trubit BTCEX QMall CoinEx BtcTurk PRO LATOKEN LocalTrade Coinbase Exchange Bitazza BitStorage FameEX Kraken Poloniex Binance US Bitfinex Bitci TR]
3:59PM INF providers supporting USDT: [Bitfinex Kraken Crypto.com Exchange Coinbase Exchange WhiteBIT BTSE Coinzoom]
3:59PM ERR failed to start currency provider tracker error="json: cannot unmarshal object into Go value of type []config.coinList"

Proposal


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions