test: add project display_text compatibility and import coverage - #335
test: add project display_text compatibility and import coverage#335dheeraj12347 wants to merge 1 commit into
Conversation
|
Hi @sudo87 and @DaanHoogland , I’ve added a follow-up contribution in PR #335 for the cloudstack_project display_text migration. I focused on validating the compatibility behavior introduced by the new display_text field: Added acceptance coverage for configurations using display_text. The follow-up changes are in commit 37ebc48 on the PR. I’d appreciate your review and any feedback on whether you’d prefer the import compatibility handling or test structure to be adjusted further. |
37ebc48 to
b300069
Compare
|
Hi @sudo87 @DaanHoogland , since PR #332 has now been merged, I’ve followed up with PR #335 to add acceptance coverage for the display_text compatibility changes introduced there. I’ve added coverage for: display_text configuration I also cleaned up the branch so PR #335 is now based on the current main and contains only the follow-up changes in a single commit. The complete cloudstack_project acceptance suite passes locally (11/11), and git diff --check is clean. The updated PR is pushed and ready for review. Please let me know if you’d like me to adjust anything in the test structure or compatibility handling. |
Summary
Add acceptance coverage for the
cloudstack_projectdisplay_textmigration and fix an import-state compatibility issue discovered during testing.The existing resource supports the new snake_case
display_textfield while retaining the deprecateddisplaytextfield for backwards compatibility. These changes exercise both paths against the CloudStack simulator and verify that existing project behavior remains intact.Changes
display_text.display_textand deprecateddisplaytextare configured.display_textvalue.Read()state handling for cases where neither display-text field is present in configuration, such as resource import.displaytextstate representation in that case to avoid an import-state mismatch.Validation
The complete
cloudstack_projectacceptance test suite passes:TestAccCloudStackProject_basicTestAccCloudStackProject_displayTextTestAccCloudStackProject_displayTextPrecedenceTestAccCloudStackProject_updateTestAccCloudStackProject_importTestAccCloudStackProject_accountTestAccCloudStackProject_updateAccountTestAccCloudStackProject_emptyDisplayTextTestAccCloudStackProject_updateUseridTestAccCloudStackProject_updateAccountidTestAccCloudStackProject_listResult: 11/11 passing
Also verified with:
Both pass successfully.
Regression found during validation
The initial full acceptance run exposed an import-state mismatch where the imported resource contained
displaytextwhile the provider read populateddisplay_text.The
Read()logic was adjusted to distinguish between:displaytextconfigurations,display_textconfigurations, andThe import acceptance test now passes without affecting the existing project acceptance tests.