thrasher-corp / gocryptotrader

A cryptocurrency trading bot and framework supporting multiple exchanges written in Golang.
MIT License
2.95k stars 793 forks source link

Tests: Various race fixes and move TestFixtureToDataHandler #1534

Closed gbjk closed 1 month ago

gbjk commented 2 months ago

Type of change

How has this been tested

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 74.79675% with 31 lines in your changes are missing coverage. Please review.

Project coverage is 37.87%. Comparing base (34ef09d) to head (93fee81).

:exclamation: Current head 93fee81 differs from pull request most recent head 0708926. Consider uploading reports for the commit 0708926 to get more accurate results

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534/graphs/tree.svg?width=650&height=150&src=pr&token=41784B23TS&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp)](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp) ```diff @@ Coverage Diff @@ ## master #1534 +/- ## ========================================== + Coverage 35.89% 37.87% +1.97% ========================================== Files 409 412 +3 Lines 177453 147950 -29503 ========================================== - Hits 63699 56031 -7668 + Misses 105899 84057 -21842 - Partials 7855 7862 +7 ``` | [Files](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp) | Coverage Δ | | |---|---|---| | [currency/pair.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&filepath=currency%2Fpair.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-Y3VycmVuY3kvcGFpci5nbw==) | `86.90% <100.00%> (+2.12%)` | :arrow_up: | | [exchanges/okx/okx\_websocket.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&filepath=exchanges%2Fokx%2Fokx_websocket.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL29reC9va3hfd2Vic29ja2V0Lmdv) | `35.69% <100.00%> (+3.18%)` | :arrow_up: | | [exchanges/sharedtestvalues/sharedtestvalues.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&filepath=exchanges%2Fsharedtestvalues%2Fsharedtestvalues.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL3NoYXJlZHRlc3R2YWx1ZXMvc2hhcmVkdGVzdHZhbHVlcy5nbw==) | `70.23% <100.00%> (-1.74%)` | :arrow_down: | | [exchanges/exchange.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&filepath=exchanges%2Fexchange.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2V4Y2hhbmdlLmdv) | `79.74% <80.00%> (+3.52%)` | :arrow_up: | | [exchanges/gateio/gateio.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&filepath=exchanges%2Fgateio%2Fgateio.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL2dhdGVpby9nYXRlaW8uZ28=) | `16.34% <60.00%> (+2.15%)` | :arrow_up: | | [exchanges/okx/okx.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&filepath=exchanges%2Fokx%2Fokx.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL29reC9va3guZ28=) | `22.53% <60.00%> (+2.38%)` | :arrow_up: | | [currency/manager.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&filepath=currency%2Fmanager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-Y3VycmVuY3kvbWFuYWdlci5nbw==) | `94.96% <95.58%> (+1.53%)` | :arrow_up: | | [exchanges/okx/okx\_wrapper.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&filepath=exchanges%2Fokx%2Fokx_wrapper.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-ZXhjaGFuZ2VzL29reC9va3hfd3JhcHBlci5nbw==) | `33.29% <42.85%> (+2.58%)` | :arrow_up: | | [internal/testing/exchange/exchange.go](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534?src=pr&el=tree&filepath=internal%2Ftesting%2Fexchange%2Fexchange.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp#diff-aW50ZXJuYWwvdGVzdGluZy9leGNoYW5nZS9leGNoYW5nZS5nbw==) | `47.32% <0.00%> (-3.49%)` | :arrow_down: | ... and [382 files with indirect coverage changes](https://app.codecov.io/gh/thrasher-corp/gocryptotrader/pull/1534/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=thrasher-corp)
gbjk commented 2 months ago

Fixed with 2e9e7d67 and 1481244a In both cases I've shied away from going and changing everything to remove the (very) thin wrappers around CurrencyManager methods Also haven't gone hunting for other examples of intrusion (yet)

gbjk commented 2 months ago

@shazbert Shout when you're done with this (and/or resolve threads). I'll rebase it on master and resolve the conflict before @gloriousCode starts his review.

gbjk commented 2 months ago

@shazbert Following discussion with @thrasher- I've switched it back to using a new PairsManager.IsAssetSupported.

Fixed 93fee81

Everything else was a rebase of what you've already seen.