fedora-infra / pagure-exporter

Simple exporter tool that helps migrate repository files, data assets and issue tickets from projects on Pagure to GitLab
GNU General Public License v3.0
6 stars 6 forks source link

Add testing support using VCR.py #78

Closed gridhead closed 10 months ago

gridhead commented 10 months ago

Add testing support using VCR.py

Fixes #42

gridhead commented 10 months ago

I used this library to speed things up significantly and use fewer resources when it comes to testing HTTP API requests made to Pagure and GitLab. The documentation/blogpost here was handy in helping me to set up VCR.py.

@Zlopez I could use a review here.

gridhead commented 10 months ago

One of the previous test runs actually connected to GitLab.com to make testing HTTP API requests and used a lot of networking and computing resources while taking as long 3 minutes and 11 seconds to complete. As external services are used, the reliability of the testcases also depend on the services' health, network conditions etc.

With the use of VCR.py, only those HTTP API requests are conveyed all the way up to GitLab.com that are required to test the functionality of cloning and transferring the repository assets. The responses to the majority of HTTP API requests are emulated in this test run and that brings down the time to as low as 1 minute and 14 seconds.

That is approximately 61.25% time saved on test runs with significant improvement on the reliability of those!

gridhead commented 10 months ago

Thanks for the review, @samyak-jn!