-
Notifications
You must be signed in to change notification settings - Fork 123
CSPL-957: Automation tests to verify deletion of C3 SVA & refactoring of test cases to align with the model of "CRUD of SVAs" #301
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
Conversation
b87a6cc
to
171426c
Compare
a588970
to
79d0af2
Compare
@jambrosiano Can you please provide detailed test steps and also passing runs as the fix has been merged. |
test/testenv/verificationutils.go
Outdated
} | ||
} | ||
|
||
// VerifyPVCExists verifies if PVC exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VerifyPVCExists
vs VerifyPVC
as we testing existing or not existing depending on value of expectedtoExist
test/testenv/verificationutils.go
Outdated
result = true | ||
logf.Log.Info("PVC status (exists or not) is as expected: ", "PVC", pvcName, "STATUS", pvcexists, "EXPECTED", expectedtoExist) | ||
} else { | ||
err := errors.New("incorrect PVC status (exists when it shouldn't or the opposite): ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be just an INFO Log. As test will fail in this scenario. Also instead of using logf
testenvInstance.Log.Info("Incorrect PVC Status", "PVC NAME", pvcName, "STATUS", pvcexists, "EXPECTED", expectedtoExist)
test/testenv/verificationutils.go
Outdated
} | ||
|
||
// VerifyPVCExists verifies if PVC exist | ||
func VerifyPVCExists(deployment *Deployment, testenvInstance *TestEnv, ns string, pvcName string, expectedtoExist bool, verificationTimeout time.Duration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expectedtoExist
vs expectedToExist
test/testenv/verificationutils.go
Outdated
func VerifyPVCExists(deployment *Deployment, testenvInstance *TestEnv, ns string, pvcName string, expectedtoExist bool, verificationTimeout time.Duration) { | ||
gomega.Eventually(func() bool { | ||
result := false | ||
pvcexists := false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pvcexists
vs pvcExists
test/testenv/verificationutils.go
Outdated
PvcName = fmt.Sprintf(PVCString, "var", deployment.GetName(), deploymentType, 0) | ||
VerifyPVCExists(deployment, testenvInstance, testenvInstance.GetName(), PvcName, expectedtoExist, verificationTimeout) | ||
} else { | ||
for i := 0; i <= 2; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work if deployment has more/less than 2. I think its not good to hardcode number of nodes here ?
This can be accepted as instances
parameter and the whole function can be refactored into a simple for loop.
pvcKind := []string{"etc", "var"}
for i := 0, i < instances ; i++ {
for _, pvcVolumeKind := range pvcKind {
pvcName := fmt.Sprintf(PVCString, pvcVolumeKind, deployment.GetName(), deploymentType, i)
VerifyPVCExists(deployment, testenvInstance, testenvInstance.GetName(), PvcName, expectedtoExist, verificationTimeout)
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
test/testenv/verificationutils.go
Outdated
// VerifyPVCsPerDeployment verifies for a given deployment if PVCs (etc and var) exists | ||
func VerifyPVCsPerDeployment(deployment *Deployment, testenvInstance *TestEnv, deploymentType string, expectedtoExist bool, verificationTimeout time.Duration) { | ||
if deploymentType == "shc-deployer" || deploymentType == "cluster-master" { | ||
PvcName := fmt.Sprintf(PVCString, "etc", deployment.GetName(), deploymentType, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PvcName
first letter should be capital for only exported kinds.
testenv.VerifyRFSFMet(deployment, testenvInstance) | ||
|
||
// Verify CPU limits on Indexers before updating the CR | ||
for i := 0; i <= 2; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of hardcoding 2 this can be stored in variable called indexerCount
testenv.SearchHeadClusterReady(deployment, testenvInstance) | ||
|
||
// Verify CPU limits after updating the CR | ||
for i := 0; i <= 2; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Store number of search heads asa searchHeadCount
63557dc
to
e52780c
Compare
74de6cf
to
919b785
Compare
ff1c3fc
to
8d0e425
Compare
test/testenv/verificationutils.go
Outdated
logf.Log.Info("PVC status (exists or not) is as expected: ", "PVC", pvcName, "STATUS", pvcExists, "EXPECTED", expectedToExist) | ||
} else { | ||
testenvInstance.Log.Info("Incorrect PVC Status", "PVC NAME", pvcName, "STATUS", pvcExists, "EXPECTED", expectedToExist) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different log objects used on line 524 vs 526
90dda03
to
a56e757
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, a new PR will cover the Deletion part for SVAs for M4 & S1
Adding new test for the bug described CSPL-780:
Refactor of the 'custom_resource_crud' folder:
Tests runs:

New test:
Refactored tests:


