tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Using `requre` in our intergration tests

Open LecrisUT opened this issue 3 months ago • 2 comments

Seeing requre in action, I think it would a very good asset for our test suite to guarantee we are using some realistic requests. It basically does one real request and records the output so that next time it tries to do the same request (in the test-suite for example) it redirects it to the recorded data instead. @vaibhavdaren @AthreyVinay would you be interested in researching that and would you have the cycles for it?

It seems we can also use it for cli commands and its from packit folks, so we can get some feedback from @lachmanfrantisek on the state and usefulness of that project

LecrisUT avatar Nov 13 '25 10:11 LecrisUT

Let's investigate! See the third point, check for possible alternatives too.

Possible issues:

  1. requre stores possibly a lot of data, Polarion tests are kept in a separate repository;
  2. effectively new tool for us, might require some time to get to know how to use it effectively when API changes;
  3. Packit actually considers moving away because of the lack of maintenance but found no real alternative.

happz avatar Nov 19 '25 09:11 happz

As far as I know requre is the only solution that can record any call. Here are the http-only alternatives:

  • https://vcrpy.readthedocs.io/en/latest/
  • https://betamax.readthedocs.io/en/latest/

Downside of requre is it's code complexity making it hard to maintain. Also, I don't know about any big user than Packit itself. (But Packit and OGR library uses that a lot.)

Let me know if you need any help -- I've spent some with requre code working on all the (hopefully handy..;) user-facing decorators...

lachmanfrantisek avatar Nov 19 '25 09:11 lachmanfrantisek