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

cleanup created data #6

Open
Leemur89 opened this issue Mar 29, 2024 · 4 comments
Open

cleanup created data #6

Leemur89 opened this issue Mar 29, 2024 · 4 comments

Comments

@Leemur89
Copy link

Hello,

It would be nice to have a cleanup mechanism to delete all the data that has been created using the openapidriver: both when testing the POST requests and also when a data is created to test the GET/PATCH...

As an acceptable workaround, we could offer a way to get the list of all the requests made, and from there in robot I could do the cleanup (that would also offer more post processing capabilities)

Thanks

@Leemur89
Copy link
Author

Leemur89 commented Mar 29, 2024

for the workaround I've raised #7

@robinmackaij
Copy link
Collaborator

I need some time to think this through. It'd indeed be nice to have a mechanic like this, but when there are dependencies between resources, simply attempting a delete isn't guaranteed to succeed.

All requests made could be extracted from the log / output.xml since Authorized Request is a keyword (so logged by default, with TRACE level logging outputting all incoming parameters and the returned value).

I think the best way to handle this is to handle it using a Listener. Using a Listener to keep track of created / altered resources has the advantage that the libraries are not affected and a Listener can easily be adapted for a specific API (where resource dependencies may apply).

It'd definitely be nice to add an example Listener implementation to the repo.

@Leemur89
Copy link
Author

Problem with listener is that you need to get the keyword results (to know the id of the object that has been created), and that is not available in RF 6.
It seems that the only way to get keyword results is by using rf 7.0, this is a new feature in the listener v3
However, this openapi library does not support rf 7.0 yet :(

@robinmackaij
Copy link
Collaborator

You're right, for a Listener RF 7+ is needed and indeed, 7.0.0 is not compatible due to a breaking change that is planned to be reversed in 7.0.1 which will hopefully be released soon.

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

2 participants