Could you please fix the test cases such as OpenStackVolumeAttachDetachTest and OpenStackInstanceExtraTest? See also at https://www.drupal.org/pift-ci-job/1684133. The other test case errors already existed, so please focus on two test case errors in this patch.
The following code should be placed into OpenStackCloudTestEntityTrait so that we don't have to add $is_openstack = FALSE which is the OpenStack-specific code. I like the approach to re-use the existing code and not introducing the similar method, however in this case I don't feel we should mix the logic for both AWS an OpenStack at createServerTemplateTestEntity.
1. Fixed OpenStackVolumeAttachDetachTest and OpenStackInstanceExtraTest testcase errors.
2. Refactored code of createServerTemplateTestEntity.
3. Refactored code of createInstanceTestFormData.
4. Sorry, there was a mistake. Need to change it to list openstack instances for OpenStack Instance list as edit openstack instances permission gives an access denied in testcase.
5. yes, OpenStackInstanceTest::class is correct. getMockDataFileContent function read mock data of respective testcase. For example, If we add OpenStackInstanceTest::class, that will be getting mock data from OpenStackInstanceTest.yml file. InstanceTest::class is added in addInstanceMockData of AwsCloudTestMockTrait. I have refactored that code as below
Thank you for the update. It looks good to me now. Thank you for the refactoring. It looks good to me. I'll merge the patch to 8.x-1.x and 8.x-2.x and close this issue as Fixed.
Comments
Comment #2
jigish.addweb commentedComment #3
jigish.addweb commentedComment #5
yas@jigishaddweb
Thank you for adding the test case.
OpenStackVolumeAttachDetachTestandOpenStackInstanceExtraTest? See also at https://www.drupal.org/pift-ci-job/1684133. The other test case errors already existed, so please focus on two test case errors in this patch.OpenStackCloudTestEntityTraitso that we don't have to add$is_openstack = FALSEwhich is the OpenStack-specific code. I like the approach to re-use the existing code and not introducing the similar method, however in this case I don't feel we should mix the logic for both AWS an OpenStack atcreateServerTemplateTestEntity.OpenStackTestFormDataTrait.OpenStackInstanceTest::classis correct or not. (NotOpenStackInstance::class?)Comment #6
jigish.addweb commentedComment #7
jigish.addweb commented@yas
Thank you for your review.
1. Fixed
OpenStackVolumeAttachDetachTestandOpenStackInstanceExtraTesttestcase errors.2. Refactored code of
createServerTemplateTestEntity.3. Refactored code of
createInstanceTestFormData.4. Sorry, there was a mistake. Need to change it to
list openstack instancesfor OpenStack Instance list asedit openstack instancespermission gives an access denied in testcase.5. yes,
OpenStackInstanceTest::classis correct.getMockDataFileContentfunction read mock data of respective testcase. For example, If we addOpenStackInstanceTest::class, that will be getting mock data fromOpenStackInstanceTest.ymlfile.InstanceTest::classis added inaddInstanceMockDataof AwsCloudTestMockTrait. I have refactored that code as belowPlease review the updated patch.
Thanks
Comment #8
yas@jigishaddweb
Thank you for fixes. For 5., in that case, could you please add more information for the parameter? It should be:
FROM:
TO: (for both above)
Comment #9
jigish.addweb commentedComment #10
jigish.addweb commented@yas
I changed the parameter information as you suggested.
Please review the updated patch.
Thanks
Comment #11
yas@jigishaddweb
Thank you for the update. It looks good to me now. Thank you for the refactoring. It looks good to me. I'll merge the patch to
8.x-1.xand8.x-2.xand close this issue asFixed.Comment #14
yas