Skip to content
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

Update Default for UTs #97

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Update Default for UTs #97

merged 1 commit into from
Nov 28, 2023

Conversation

doriac11
Copy link
Contributor

Description

  • Set some default values and clean up some of the tests to work with the unit test mock server.

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Unit tests
TF_ACC=1 go test -v -timeout 1h
=== RUN   TestAccHostGroupDs_FetchHostGroup
--- PASS: TestAccHostGroupDs_FetchHostGroup (29.34s)
=== RUN   TestAccHostDs_FetchHost
--- PASS: TestAccHostDs_FetchHost (24.33s)
=== RUN   TestAccHostDs_FetchHostNegative
--- PASS: TestAccHostDs_FetchHostNegative (4.48s)
=== RUN   TestAccProtectionPolicyDs_FetchPolicy
--- PASS: TestAccProtectionPolicyDs_FetchPolicy (24.85s)
=== RUN   TestAccProtectionPolicyDs_FetchPolicyNegative
--- PASS: TestAccProtectionPolicyDs_FetchPolicyNegative (4.48s)
=== RUN   TestAccSnapshotRuleDs_FetchSnapshotRule
--- PASS: TestAccSnapshotRuleDs_FetchSnapshotRule (27.56s)
=== RUN   TestAccVolumeGroupSnapshotDs_FetchVolumeGroupSnapshot
--- PASS: TestAccVolumeGroupSnapshotDs_FetchVolumeGroupSnapshot (28.11s)
=== RUN   TestAccVolumeGroupDs_FetchVolumeGroup
--- PASS: TestAccVolumeGroupDs_FetchVolumeGroup (28.22s)
=== RUN   TestAccVolumeDs_FetchVolumeSnapshot
--- PASS: TestAccVolumeDs_FetchVolumeSnapshot (29.51s)
=== RUN   TestAccVolumeDs_FetchVolume
--- PASS: TestAccVolumeDs_FetchVolume (25.92s)
=== RUN   TestAccHostGroup_Create
--- PASS: TestAccHostGroup_Create (25.48s)
=== RUN   TestAccHostGroup_CreateWithInvalidValues
--- PASS: TestAccHostGroup_CreateWithInvalidValues (4.07s)
=== RUN   TestAccHostGroup_CreateWithInvalidHostID
--- PASS: TestAccHostGroup_CreateWithInvalidHostID (4.00s)
=== RUN   TestAccHostGroup_CreateWithBlankName
--- PASS: TestAccHostGroup_CreateWithBlankName (1.80s)
=== RUN   TestAccHostGroup_CreateWithHostName
--- PASS: TestAccHostGroup_CreateWithHostName (15.64s)
=== RUN   TestAccHostGroup_CreateWithInvalidHostName
--- PASS: TestAccHostGroup_CreateWithInvalidHostName (4.04s)
=== RUN   TestAccHostGroup_CreateWithHostIDAndName
--- PASS: TestAccHostGroup_CreateWithHostIDAndName (1.66s)
=== RUN   TestAccHostGroup_ImportFailure
--- PASS: TestAccHostGroup_ImportFailure (2.82s)
=== RUN   TestAccHost_Create
--- PASS: TestAccHost_Create (10.89s)
=== RUN   TestAccHost_CreateSingleCHAP
--- PASS: TestAccHost_CreateSingleCHAP (9.04s)
=== RUN   TestAccHost_CreateWithoutPolicy
--- PASS: TestAccHost_CreateWithoutPolicy (1.74s)
=== RUN   TestAccHost_CreateWithoutName
--- PASS: TestAccHost_CreateWithoutName (1.59s)
=== RUN   TestAccHost_Rename
--- PASS: TestAccHost_Rename (15.75s)
=== RUN   TestAccHost_AddRemoveInitiators
--- PASS: TestAccHost_AddRemoveInitiators (22.98s)
=== RUN   TestAccHost_ModifyInitiators
--- PASS: TestAccHost_ModifyInitiators (16.68s)
=== RUN   TestAccHost_ImportFailure
--- PASS: TestAccHost_ImportFailure (2.77s)
=== RUN   TestAccProtectionPolicy_Create
--- PASS: TestAccProtectionPolicy_Create (11.07s)
=== RUN   TestAccProtectionPolicy_Update
--- PASS: TestAccProtectionPolicy_Update (15.65s)
=== RUN   TestAccProtectionPolicy_CreateWithInvalidValues
--- PASS: TestAccProtectionPolicy_CreateWithInvalidValues (4.05s)
=== RUN   TestAccProtectionPolicy_UpdateError
--- PASS: TestAccProtectionPolicy_UpdateError (12.26s)
=== RUN   TestAccProtectionPolicy_CreateWithMutuallyExclusiveParams
--- PASS: TestAccProtectionPolicy_CreateWithMutuallyExclusiveParams (3.14s)
=== RUN   TestAccProtectionPolicy_CreateWithSnapshotRuleName
--- PASS: TestAccProtectionPolicy_CreateWithSnapshotRuleName (8.63s)
=== RUN   TestAccProtectionPolicy_CreateWithReplicationRuleName
--- PASS: TestAccProtectionPolicy_CreateWithReplicationRuleName (9.02s)
=== RUN   TestAccProtectionPolicy_ImportFailure
--- PASS: TestAccProtectionPolicy_ImportFailure (2.82s)
=== RUN   TestAccVolumeSnapshot_Create
--- PASS: TestAccVolumeSnapshot_Create (10.95s)
=== RUN   TestAccVolumeSnapshot_InvalidSnapshotVolumeID
--- PASS: TestAccVolumeSnapshot_InvalidSnapshotVolumeID (4.00s)
=== RUN   TestAccVolumeSnapshot_UpdateSnapshotRename
--- PASS: TestAccVolumeSnapshot_UpdateSnapshotRename (15.62s)
=== RUN   TestAccVolumeSnapshot_UpdateSnapshotVolumeName
--- PASS: TestAccVolumeSnapshot_UpdateSnapshotVolumeName (11.71s)
=== RUN   TestAccVolumeSnapshot_CreateWithoutName
--- PASS: TestAccVolumeSnapshot_CreateWithoutName (9.42s)
=== RUN   TestAccVolumeSnapshot_CreateWithoutExpiration
--- PASS: TestAccVolumeSnapshot_CreateWithoutExpiration (8.52s)
=== RUN   TestAccVolumeSnapshot_CreateWithoutVolume
--- PASS: TestAccVolumeSnapshot_CreateWithoutVolume (1.61s)
=== RUN   TestAccVolumeSnapshot_CreateWithVolumeName
--- PASS: TestAccVolumeSnapshot_CreateWithVolumeName (8.64s)
=== RUN   TestAccVolumeSnapshot_CreateWithInvalidVolumeName
--- PASS: TestAccVolumeSnapshot_CreateWithInvalidVolumeName (4.13s)
=== RUN   TestAccVolumeSnapshot_ImportFailure
--- PASS: TestAccVolumeSnapshot_ImportFailure (2.74s)
=== RUN   TestAccSnapshotRule_CreateSnapShotRule
--- PASS: TestAccSnapshotRule_CreateSnapShotRule (17.38s)
=== RUN   TestAccSnapshotRule_UpdateSnapShotRule
--- PASS: TestAccSnapshotRule_UpdateSnapShotRule (16.14s)
=== RUN   TestAccSnapshotRule_CreateSnapShotRuleWithInvalidValues
--- PASS: TestAccSnapshotRule_CreateSnapShotRuleWithInvalidValues (6.48s)
=== RUN   TestAccSnapshotRule_ImportFailure
--- PASS: TestAccSnapshotRule_ImportFailure (2.76s)
=== RUN   TestAccSnapshotRule_ImportSuccess
--- PASS: TestAccSnapshotRule_ImportSuccess (10.88s)
=== RUN   TestAccStorageContainer_Create
--- PASS: TestAccStorageContainer_Create (11.13s)
=== RUN   TestAccStorageContainer_Update
--- PASS: TestAccStorageContainer_Update (19.17s)
=== RUN   TestAccStorageContainer_CreateWithInvalidValues
--- PASS: TestAccStorageContainer_CreateWithInvalidValues (6.49s)
=== RUN   TestAccStorageContainer_ImportFailure
--- PASS: TestAccStorageContainer_ImportFailure (2.97s)
=== RUN   TestAccVolumeGroupSnapshot_Create
--- PASS: TestAccVolumeGroupSnapshot_Create (11.01s)
=== RUN   TestAccVolumeGroupSnapshot_InvalidSnapshotVolumegroupID
--- PASS: TestAccVolumeGroupSnapshot_InvalidSnapshotVolumegroupID (4.11s)
=== RUN   TestAccVolumeGroupSnapshot_UpdateSnapshotRename
--- PASS: TestAccVolumeGroupSnapshot_UpdateSnapshotRename (15.96s)
=== RUN   TestAccVolumeGroupSnapshot_UpdateSnapshotVolumeName
--- PASS: TestAccVolumeGroupSnapshot_UpdateSnapshotVolumeName (11.71s)
=== RUN   TestAccVolumeGroupSnapshot_CreateWithoutName
--- PASS: TestAccVolumeGroupSnapshot_CreateWithoutName (1.62s)
=== RUN   TestAccVolumeGroupSnapshot_CreateWithoutExpiration
--- PASS: TestAccVolumeGroupSnapshot_CreateWithoutExpiration (8.78s)
=== RUN   TestAccVolumeGroupSnapshot_CreateWithoutVolume
--- PASS: TestAccVolumeGroupSnapshot_CreateWithoutVolume (1.66s)
=== RUN   TestAccVolumeGroupSnapshot_CreateWithVolumeGroupName
--- PASS: TestAccVolumeGroupSnapshot_CreateWithVolumeGroupName (9.20s)
=== RUN   TestAccVolumeGroupSnapshot_CreateWithInvalidVolumeGroupName
--- PASS: TestAccVolumeGroupSnapshot_CreateWithInvalidVolumeGroupName (4.09s)
=== RUN   TestAccVolumeGroupSnapshot_ImportFailure
--- PASS: TestAccVolumeGroupSnapshot_ImportFailure (2.88s)
=== RUN   TestAccVolumeGroup_Create
--- PASS: TestAccVolumeGroup_Create (11.08s)
=== RUN   TestAccVolumeGroup_CreateWithoutName
--- PASS: TestAccVolumeGroup_CreateWithoutName (1.73s)
=== RUN   TestAccVolumeGroup_CreateWithInvalidPolicy
--- PASS: TestAccVolumeGroup_CreateWithInvalidPolicy (4.30s)
=== RUN   TestAccVolumeGroup_CreateWithInvalidVolume
--- PASS: TestAccVolumeGroup_CreateWithInvalidVolume (4.43s)
=== RUN   TestAccVolumeGroup_Update
--- PASS: TestAccVolumeGroup_Update (16.59s)
=== RUN   TestAccVolumeGroup_UpdateError
--- PASS: TestAccVolumeGroup_UpdateError (13.53s)
=== RUN   TestAccVolumeGroup_CreateWithVolumeName
--- PASS: TestAccVolumeGroup_CreateWithVolumeName (8.77s)
=== RUN   TestAccVolumeGroup_CreateWithPolicyName
--- PASS: TestAccVolumeGroup_CreateWithPolicyName (8.74s)
=== RUN   TestAccVolumeGroup_CreateWithInvalidPolicyName
--- PASS: TestAccVolumeGroup_CreateWithInvalidPolicyName (4.15s)
=== RUN   TestAccVolumeGroup_CreateWithVolumeIDAndName
--- PASS: TestAccVolumeGroup_CreateWithVolumeIDAndName (1.63s)
=== RUN   TestAccVolumeGroup_CreateWithPolicyIDAndName
--- PASS: TestAccVolumeGroup_CreateWithPolicyIDAndName (1.66s)
=== RUN   TestAccVolumeGroup_UpdateAddPolicy
--- PASS: TestAccVolumeGroup_UpdateAddPolicy (15.86s)
=== RUN   TestAccVolumeGroup_UpdateAddVolume
--- PASS: TestAccVolumeGroup_UpdateAddVolume (16.60s)
=== RUN   TestAccVolumeGroup_UpdateAddPolicyNegative
--- PASS: TestAccVolumeGroup_UpdateAddPolicyNegative (12.49s)
=== RUN   TestAccVolumeGroup_UpdateRemovePolicy
--- PASS: TestAccVolumeGroup_UpdateRemovePolicy (15.29s)
=== RUN   TestAccVolumeGroup_UpdateRemoveVolume
--- PASS: TestAccVolumeGroup_UpdateRemoveVolume (15.35s)
=== RUN   TestAccVolumeGroup_ImportFailure
--- PASS: TestAccVolumeGroup_ImportFailure (2.79s)
=== RUN   TestAccVolume_CreateVolume
--- PASS: TestAccVolume_CreateVolume (12.25s)
=== RUN   TestAccVolume_UpdateVolumeRename
--- PASS: TestAccVolume_UpdateVolumeRename (16.33s)
=== RUN   TestAccVolume_CreateVolumeWithMBInInt
--- PASS: TestAccVolume_CreateVolumeWithMBInInt (8.73s)
=== RUN   TestAccVolume_CreateVolumeWithTBInFloat
--- PASS: TestAccVolume_CreateVolumeWithTBInFloat (9.09s)
=== RUN   TestAccVolume_CreateVolumeWithPB
--- PASS: TestAccVolume_CreateVolumeWithPB (1.61s)
=== RUN   TestAccVolume_CreateVolumeWithInvalidCapUnit
--- PASS: TestAccVolume_CreateVolumeWithInvalidCapUnit (1.60s)
=== RUN   TestAccVolume_UpdateVolumeGb
--- PASS: TestAccVolume_UpdateVolumeGb (16.20s)
=== RUN   TestAccVolume_UpdateVolumeGbError1
--- PASS: TestAccVolume_UpdateVolumeGbError1 (13.19s)
=== RUN   TestAccVolume_UpdateVolumeSizeGbToTb
--- PASS: TestAccVolume_UpdateVolumeSizeGbToTb (16.26s)
=== RUN   TestAccVolume_UpdateVolumeApplianceID
--- PASS: TestAccVolume_UpdateVolumeApplianceID (8.95s)
=== RUN   TestAccVolume_UpdateVolumeInvalidApplianceID
--- PASS: TestAccVolume_UpdateVolumeInvalidApplianceID (4.12s)
=== RUN   TestAccVolume_UpdateVolumePerformancePolicyID
--- PASS: TestAccVolume_UpdateVolumePerformancePolicyID (1.60s)
=== RUN   TestAccVolume_AddVolumeGroupID
--- PASS: TestAccVolume_AddVolumeGroupID (9.09s)
=== RUN   TestAccVolume_UpdateVolumeGroupID
--- PASS: TestAccVolume_UpdateVolumeGroupID (24.04s)
=== RUN   TestAccVolume_AddHostID
--- PASS: TestAccVolume_AddHostID (8.85s)
=== RUN   TestAccVolume_UpdateHostID
--- PASS: TestAccVolume_UpdateHostID (24.21s)
=== RUN   TestAccVolume_UpdateHostGroupID
--- PASS: TestAccVolume_UpdateHostGroupID (18.21s)
=== RUN   TestAccVolume_UpdateHostAndHostGroupID
--- PASS: TestAccVolume_UpdateHostAndHostGroupID (12.28s)
=== RUN   TestAccVolume_AddHostGroupID
--- PASS: TestAccVolume_AddHostGroupID (8.92s)
=== RUN   TestAccVolume_AddHostAndHostGroupID
--- PASS: TestAccVolume_AddHostAndHostGroupID (3.70s)
=== RUN   TestAccVolume_ImportFailure
--- PASS: TestAccVolume_ImportFailure (2.82s)
PASS
ok      terraform-provider-powerstore/powerstore

@@ -26,7 +26,7 @@ import (
)

// Test to Fetch Host Groups
func TestAccHostGroup_FetchHostGroup(t *testing.T) {
func TestAccHostGroupDs_FetchHostGroup(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the Ds here so that the tests can be run independently from the resource test.

shekhar-j
shekhar-j previously approved these changes Nov 21, 2023
prajwalpatil25
prajwalpatil25 previously approved these changes Nov 21, 2023
- Set some default values and clean up some of the tests to work with
  the unit test mock server.
@doriac11 doriac11 merged commit 223fa24 into main Nov 28, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants