Spike: investigate saving mock security policy yaml in yaml files
The following discussion from !141834 (merged) should be addressed:
-
@ekigbo started a discussion: (+1 comment)
nitpick: this kind of looks more like a YAML file
🤔 , I wonder if it might be easier to maintain this if we maybe extract it into a separate mock file? Same with the one below, WDYT?
@aturinske
response:
this kind of looks more like a YAML file
I agree; it is because the security policies are saved as yaml, but there is a UI where a user can make changes with dropdowns and inputs that modify the yaml in a more approachable way. Thus, there is a lot of testing of "if user does x, ensure the correct yaml is generated to be saved"
I wonder if it might be easier to maintain this if we maybe extract it into a separate mock file?
That is a very interesting idea; I definitely think it would look cleaner to have the yaml in actual yaml files, but we end up having a lot of variations of the security policies, so it might be a lot of yaml files if we can only have one security policy per file.
I am going to open up a follow-up issue to address this as this would help not only our integration tests, but also our unit tests (this file and this file look even MORE like yaml files
😬 )
Summary
- the integration and unit test mock files have a lot of security policy yaml that could be more maintainable in yaml files; can we move the mocks into yaml files?
- the integration and unit test mock files have a lot of repeated potions of the mocks (a lot of the yaml/objects differ only by an action/rule where the name/description/enabled are the same); could some repetition be removed by implementing some sort of system of generating the mock?