fix: duplicate uuid issue in test data by adding a new load_valid_model_from_json function - #2142
fix: duplicate uuid issue in test data by adding a new load_valid_model_from_json function#2142LAKSHJAIN14 wants to merge 6 commits into
Conversation
Signed-off-by: LAKSHJAIN14 <jainlaksh07@gmail.com>
0da07d2 to
1742e56
Compare
Signed-off-by: LAKSHJAIN14 <jainlaksh07@gmail.com>
…the oscal modelis valid or not Signed-off-by: LAKSHJAIN14 <jainlaksh07@gmail.com>
|
So added a new load_valid_model_from_json function which checks if the oscal model loading is valid or not and have used it wherever possible and change the name of the previous function load_from_json to load_from_json_without_check. Couldn't use the new function in some tests where leveraged_ssp or leveraging_ssp was being used as imodel_is_valid function also checks for RuleParametersValidator. This validator needs to check if the rules in your SSP match the rules in the Profile your SSP is based on and since its a dummy test so the linked profile is not there, If we really want the check then we could load the profile and the catalog in each of the functions. |
|
@LAKSHJAIN14 Please resolve conflicts, thx! |
|
resolved the conflicts, PTAL |
64cc98c to
4fa5f11
Compare
Types of changes
develop->main)Summary
As discussed during the community meeting, This is the first PR related to the issue #2089 which fixes all the duplicate uuids in comp_def test files that were there and I have looked if there exists a current check which checks for duplicate uuid and yeah there is a check in /tests/trestle/core/commands/validate_test.py but it doesn't load any of the file from the test data , it loads comp_def using the sample_component_definition pytest fixture and then changes uuid to become duplicate and then check which is sufficent I guess,
There is another file with duplicate uuid which is tests/data/yaml/bad_component_dup_uuid.yaml but I couldn't find any test function using it so i think its a dead data and this file is also there in the issue #2116 ,So I guess we can handle it there.
If these all things seem ok then I could look into the test_utils.load_from_json function and have it also validate like it happens when we do trestle import but I think we could do that in another PR and discuss it there.
@degenaro @vikas-agarwal76