You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a cool method to speed up development of tests. It would be great if gabbi supported it too.
Here is the idea:
a test defines that a response should be compared with a gold file (reference to gold file can be custom configurable per every test)
gabbi runs tests with a new flag 'generate-gold-files', which forces gabbi to capture response bodies and headers and (re-)write gold files containing the captured response data
developer reviews the gold files (usually happens one by one as tests are added one by one during development)
gabbi runs tests as usually
a) if a test has got a reference to a gold file, it captures actual response output and compares with gold file
b) if content of the actual output matches the gold file content, verification is considered to be passed
c) otherwise test is failed
This would allow me to reduce size of my test files by half at least.
The text was updated successfully, but these errors were encountered:
When I initially created gabbi I specifically did not want it to be for regression testing so left out any functionality that would allow it to be directly used for recording response bodies into future tests.
Using some scripting to glue things together it would probably relatively straightfoward to make something that you want: read the existing YAML to run requests, capture the responses to disk, process them to "new" YAML. In fact it would probably be possible using gabbi as a library for the main functionality in the tool.
While I don't have the time to create something like that or something more directly built into gabbi, I'd certainly be willing to look at a pull request that provided the functionality.
you can put it on freeze until somebody else needs it to. The ticket scope then is how to generate these gold files automatically, because checking against the files seems like already available.
There is a cool method to speed up development of tests. It would be great if gabbi supported it too.
Here is the idea:
a test defines that a response should be compared with a gold file (reference to gold file can be custom configurable per every test)
gabbi runs tests with a new flag 'generate-gold-files', which forces gabbi to capture response bodies and headers and (re-)write gold files containing the captured response data
developer reviews the gold files (usually happens one by one as tests are added one by one during development)
gabbi runs tests as usually
a) if a test has got a reference to a gold file, it captures actual response output and compares with gold file
b) if content of the actual output matches the gold file content, verification is considered to be passed
c) otherwise test is failed
This would allow me to reduce size of my test files by half at least.
The text was updated successfully, but these errors were encountered: