This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Refactor backfill for unit testing #1279
Merged
DeviaVir
merged 21 commits into
DeviaVir:unstable
from
haxwell:refactorBackfillForUnitTesting
Feb 5, 2018
Merged
Refactor backfill for unit testing #1279
DeviaVir
merged 21 commits into
DeviaVir:unstable
from
haxwell:refactorBackfillForUnitTesting
Feb 5, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
haxwell
commented
Feb 3, 2018
- An 'id' and '_id' attribute are set on the resume marker object. This is to match pre-refactor behavior.
- If an exchange uses time as opposed to trade_id in its API queries for trades, the tradeService will get the correct trade from the DB, and pass in its time. backfill not working on binance, slow/not working on gdax #1267
… Mongo collection from the database is returned. -- I investigated the SOSA Mongo module that db.trades and db.resume_markers wrapped. I couldn't determine a real benefit to SOSA, as opposed to going directly to the Mongo DB object. SOSA seems to be one abstraction too many. If I am wrong, it is easy enough to add it back. For now, simple wins.
…t-one test/_specs/commands/backfill/backfill.process.function.test.js' for example. To run all tests 'npm test'.
…flush() is called.
…dded a mock findOne function.
…e needs its getTrades() arguments as milliseconds, as opposed to a trade ID. If yes to milliseconds, it gets the trade specified by the ID, and passes its time to the exchange. Ideally, this would be handled by the exchange, but I'm trying to not touch those in this refactor, for now.
… uses time as opposed to trade ID in the API queries which return the trades.
…axwell/zenbot into refactorBackfillForUnitTesting
I was working around this in bittrex it uses a combo of numeric and time depending on where it is getting its backfill data. I was converting it to numeric only (converting both sources to use ms from 1970) is this still needed? |
field selector is missing in the trade dataset after backfill refactor. |
…ed tests for it. Added some functionality to the collection and exchange service mocks, too.
DeviaVir
approved these changes
Feb 5, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.