Closed vkhomiv-hubspot closed 5 years ago
Hi @vkhomiv-hubspot, absolutely.
Some of the non-mocked tests were relying on data on the demo account that has moved / changed and I haven't had time to fix them all.
For the request throttling, how would you suggest implementing? Do you know if the secondly limit is available in the response or headers?
Hi @pcothenet, I will help you with tests. Also going to investigate possible approaches with call limits.
For now, I see a couple of issues with the demo
account. HubSpot introduced/modified few endpoints from GET to POST, (Search for companies by domain POST /companies/v2/domains/:domain/companies
as an example). And the demo
account allows doing only GET requests, POST is prohibited, which failing a specific test for it. How to move on with I don't know yet.
Also, let's consider the case with tests in general.
Currently, they are run against the real API via the demo
account - which has few side-effects (call limits, POST is prohibited, changes on demo
account which can impact test results, etc.) so
I have two suggestions:
before
steps to set the needed configuration for the test and after
to rollback to the blank state (and each developer has to use own account for integration testing, which will solve issue with daily call limit issue)What do you think about that?
100% agree. We had started to mock most things in the previous project back in December, but that takes quite a bit.
For integration tests: for our own usage, we use our own developer account for integration testing. I believe that's the right approach too. That also takes a bit of time setting tear-downs and stuff but should be the way to go.
For CI: HubSpot tends to retire those if inactive. Would you be able to set up a non-expiring developer account that we can use in CI?
I decided to contribute here. After the download and setup, I run
npm run build
As a result, I see 102 passing 28 failing. Last few because often_secondly_rolling limit
but all other because not matching expectations. It seems like tests are outdated and need some afford to sync with updated API. Also, we need to do something with requests throttling to avoid reaching the limit.