-
Notifications
You must be signed in to change notification settings - Fork 75
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
Introduce generic OpenAPI entity cleanup for tests #348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only one more comment while looking at forty files changed :)
Maybe a separate function for the new functionality? Something like this:
func AddToCleanupList(name, entityType, parent, createdBy)
func AddToCleanupListURL(name, entityType, parent, createdBy, openApiEndpoint string)
AddToCleanupList
- would only call with the last parameter empty AddToCleanupListURL(..., "")
This is just a thought. I don't mind changing forty files if you and @dataclouder think code is easier to manage with a single function long-term.
I was on the edge between this solution and the other. I guess one more thought like that weighs id down. Let me change it. |
I was going to introduce these changes with Org VDC network PRs but because this touches many points I have split this before going with Org VDC network PR.
OpenAPI has a standartized working approach which allows to improve on current entity cleanup operations in tests.
Because delete endpoints for OpenAPI are constructed in the same fashion - all items can be deleted using low level OpenAPI function
OpenApiDeleteItem
provided endpoint (together with ID) are known. And these are easy to know once object is created.This PR sets up code for generic openapi entity cleanup (by adding two new cleanup functions
AddToCleanupListOpenApi
andPrependToCleanupListOpenApi
)and also uses it in external network V2The above code generates such entry in cleanup list:
Also fix test Test_OpenApiInlineStructCRUDRoles by using smarter time parsing library