Skip to content
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

Use of VCR.py to not depend on an Odoo server and speed up tests #45

Open
sebalix opened this issue May 7, 2019 · 4 comments
Open

Use of VCR.py to not depend on an Odoo server and speed up tests #45

sebalix opened this issue May 7, 2019 · 4 comments

Comments

@sebalix
Copy link
Collaborator

sebalix commented May 7, 2019

Like it is done on OCA/connector-magento.
Link: VCR.py

@pedrobaeza
Copy link
Member

We have the same also on connector-prestashop, but with that, we are faking the possible problems IMO.

@sebalix
Copy link
Collaborator Author

sebalix commented May 7, 2019

My idea is to put the resulting serialization of HTTP queries in Travis cache (expiration every 28 days: https://docs.travis-ci.com/user/caching/#caches-expiration). I know some issues may be hidden this way if Odoo changes its internals, but currently tests are also very slow (+ Travis jobs are shared among all OCA reporitories).

@pedrobaeza
Copy link
Member

@guewen what is your experience using VCR?

@guewen
Copy link
Member

guewen commented May 7, 2019

@guewen what is your experience using VCR?

It depends on what needs to be tested:

  • It's a blessing for unittest and refactoring your code, when the "other side" doesn't change, as you can run your "red-green-refactor" loop very fast and generally ensure you don't break existing features
  • Consequently, in a dev workflow, it makes the dev way faster because you don't have to rollback the changes on the "other side" when you want to retry an operation, you can run it on the registered responses
  • It does not replace real integration tests with a service (but it's still a weak replacement which doesn't need complex test setup)

In any case, IMO it's already worth it for the point 1 alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants