-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fetch] Testing time-dependent results, disabling cache #35
Comments
Hey @gadicc, yes I think environment variable is the easiest as well. Adding time to the cache stringOh, I got an idea regarding how we can test different responses due to the time of day, and cache them as well. Currently our test files look something like this;
..which will create a cached response for the search here; However, since the response from Yahoo depends on the time of day, we could factor in "time of day" to the cache string. I think hourly would be enough. So we could do something like this;
If tests where then to be run it would create cached responses for all the 24 hours of the day, like so:
I think the solution could be more fleshed out and improved upon, e.g how do we best automate this. But it seems like a good start to me. What do you think @gadicc? |
Hey @pudgereyem, this is a good idea in terms of effort, as we don't really have to do much planning or thinking to cover everything. The downside though is that we already have 200 tests, which run fairly quickly, but to have 200 * 24 = 4800 tests, when almost all of them are near identical, I think is a bad trade off. I think the best thing to do, even though it's a lot more effort, is to run specific timed tests for the different states of the markets, which we'll need to figure out (however, it will be great to add to our documentation too). So, a test specifically for an LSE stock when the LSE is in different states. I can't think of any other time related dependence beyond market state, can you? Having said all that, I'm not even sure if there's that much work here... as all we have to do figure out is the different market state values and which fields are dependent on that. As an example, as a result of testing the new FETCH_DEVEL env variable (see commit afcb397 above or note in README), I've added all the But my suspicious is that there's not that much more to discover. I'll run the live tests at a few different times of the day (you're welcome to do so too if you want) and we'll see what other kinds of things come up, which should give us a better idea of what direction to go. So leaving open for now. |
# [1.7.0](v1.6.0...v1.7.0) (2021-02-10) ### Bug Fixes * **index:** uhhhh s/_options/_opts/ like it's called everywhere else ([4492993](4492993)) * **moduleExec:** pass correct object to validation ([#27](#27)) ([8b0f9c7](8b0f9c7)) * **modules:** change overloading order specificy (fixes [#21](#21)) ([1806e61](1806e61)) * **quote:** extend marketState property ([0c36a60](0c36a60)) * **quote:** interface fixes, 10am UTC tests ([#35](#35)) ([1c256c7](1c256c7)) ### Features * new module recommendationsBySymbol ([#28](#28)) ([b467acb](b467acb))
Going to close this since the |
Following on from #32, thanks @pudgereyem.
I'll add a way to disable using the cached result (probably an environment variable is easiest) but this still only solves half the problem. What we actually need is cached results from all the different possible times... a pain, I know -- but what we really want is for testing to really test everything, so we can be confident moving forward that EVERYTHING works all the time, without thinking that we need to run live tests at different times of the day.
The text was updated successfully, but these errors were encountered: