Skip to content

Commit

Permalink
Revise Polarion Test Case IDs in TALM tests (#91)
Browse files Browse the repository at this point in the history
* Fixed backup and batching test case IDs

* Fixed precache test case IDs

* Fixed precache test case IDs

* Fixed talm blockingcr test case IDs

* Revised TALM blockingCR test IDs

* Test indentation

* Fix lint

* fix lint

* Added comments with Test IDs and descroptions.

* added 74752 test id

* added 64747 test id

* lint fix

* Update tests/cnf/ran/talm/tests/talm-batching.go

Co-authored-by: Kirsten Laskoski <[email protected]>

* Changed UOCR to CGU

* lint fix

---------

Co-authored-by: Joshua Clark <[email protected]>
Co-authored-by: Yang Liu <[email protected]>
Co-authored-by: Kirsten Laskoski <[email protected]>
  • Loading branch information
4 people authored Jul 10, 2024
1 parent 180401a commit 2a40983
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion tests/cnf/ran/talm/tests/talm-backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ var _ = Describe("TALM backup tests", Label(tsparams.LabelBackupTestCases), func
Expect(errorList).To(BeEmpty(), "Failed to clean up test resources on spokes")
})

It("should not affect backup on second spoke in same batch", func() {
// 74752 Unblock Backup in Batch OCP Upgrade
It("should not affect backup on second spoke in same batch", reportxml.ID("74752"), func() {
By("applying all the required CRs for backup")
// max concurrency of 2 so both spokes are in the same batch
cguBuilder := cgu.NewCguBuilder(HubAPIClient, tsparams.CguName, tsparams.TestNamespace, 2).
Expand Down
11 changes: 4 additions & 7 deletions tests/cnf/ran/talm/tests/talm-batching.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var _ = Describe("TALM Batching Tests", Label(tsparams.LabelBatchingTestCases),
})

When("a single spoke is missing", Label(tsparams.LabelMissingSpokeTestCases), func() {
// 47949 - Tests selected clusters must be non-compliant AND included in UOCR.
// 47949 - Tests selected clusters must be non-compliant AND included in CGU.
It("should report a missing spoke", reportxml.ID("47949"), func() {
By("creating the CGU with non-existent cluster and policy")
cguBuilder := cgu.NewCguBuilder(HubAPIClient, tsparams.CguName, tsparams.TestNamespace, 1).
Expand Down Expand Up @@ -200,7 +200,9 @@ var _ = Describe("TALM Batching Tests", Label(tsparams.LabelBatchingTestCases),
Expect(catSrcExistsOnSpoke2).To(BeFalse(), "Catalog source exists on spoke 2")
})

It("should continue the CGU when the first batch fails with the Continue batch timeout action", func() {
// 74753 upgrade failure of first batch would not affect second batch
It("should continue the CGU when the first batch fails with the Continue batch timeout"+
"action", reportxml.ID("74753"), func() {
By("verifying the temporary namespace does not exist on spoke1")
tempExistsOnSpoke1 := namespace.NewBuilder(Spoke1APIClient, tsparams.TemporaryNamespace).Exists()
Expect(tempExistsOnSpoke1).To(BeFalse(), "Temporary namespace already exists on spoke 1")
Expand Down Expand Up @@ -304,7 +306,6 @@ var _ = Describe("TALM Batching Tests", Label(tsparams.LabelBatchingTestCases),

When("there is a temporary namespace", Label(tsparams.LabelTempNamespaceTestCases), func() {
// 47954 - Tests upgrade aborted due to short timeout.
// 54292 - Test Policy Deletion Upon CGU Expiration
It("should report the timeout value when one cluster is in a batch and it times out", reportxml.ID("47954"), func() {
By("verifying the temporary namespace does not exist on spoke1")
tempExistsOnSpoke1 := namespace.NewBuilder(Spoke1APIClient, tsparams.TemporaryNamespace).Exists()
Expand Down Expand Up @@ -362,10 +363,6 @@ var _ = Describe("TALM Batching Tests", Label(tsparams.LabelBatchingTestCases),
})

// 47947 - Tests successful ocp and operator upgrade with canaries and multiple batches.
// 54288 - Test Cluster Selection with K8s matchLabels selector
// 54289 - Test Cluster Selection with K8s matchExpressions selector
// 54559 - CGU Multiple Selection Criteria
// 54292 - Test Policy Deletion Upon CGU Expiration
It("should complete the CGU when two clusters are successful in a single batch", reportxml.ID("47947"), func() {
By("creating the CGU and associated resources")
cguBuilder := cgu.NewCguBuilder(HubAPIClient, tsparams.CguName, tsparams.TestNamespace, 1).
Expand Down
10 changes: 5 additions & 5 deletions tests/cnf/ran/talm/tests/talm-blockingcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var _ = Describe("TALM Blocking CRs Tests", Label(tsparams.LabelBlockingCRTestCa
})

When("a blocking CR passes", func() {
// 47948 - Tests multiple UOCRs can be enabled in parallel with blocking CR.
// 47948 - Tests multiple CGUs can be enabled in parallel with blocking CR.
It("verifies CGU succeeded with blocking CR", reportxml.ID("47948"), func() {
By("creating two sets of CRs where B will be blocked until A is done")
cguA := getBlockingCGU(blockingA, 10)
Expand Down Expand Up @@ -90,8 +90,8 @@ var _ = Describe("TALM Blocking CRs Tests", Label(tsparams.LabelBlockingCRTestCa
})

When("a blocking CR fails", func() {
// 47948 - Tests multiple UOCRs can be enabled in parallel with blocking CR.
It("verifies CGU fails with blocking CR", reportxml.ID("47948"), func() {
// 74768 - Tests multiple CGUs can be enabled in parallel with blocking CR.
It("verifies CGU fails with blocking CR", reportxml.ID("74768"), func() {
By("creating two sets of CRs where B will be blocked until A is done")
cguA := getBlockingCGU(blockingA, 2)
cguB := getBlockingCGU(blockingB, 1)
Expand Down Expand Up @@ -137,8 +137,8 @@ var _ = Describe("TALM Blocking CRs Tests", Label(tsparams.LabelBlockingCRTestCa
})

When("a blocking CR is missing", func() {
// 47948 - Tests multiple UOCRs can be enabled in parallel with blocking CR.
It("verifies CGU is blocked until blocking CR created and succeeded", reportxml.ID("47948"), func() {
// 47956 - Tests multiple CGUs can be enabled in parallel with missing blocking CR.
It("verifies CGU is blocked until blocking CR created and succeeded", reportxml.ID("47956"), func() {
By("creating two sets of CRs where B will be blocked until A is done")
cguA := getBlockingCGU(blockingA, 10)
cguB := getBlockingCGU(blockingB, 15)
Expand Down
12 changes: 8 additions & 4 deletions tests/cnf/ran/talm/tests/talm-precache.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ var _ = Describe("TALM precache", Label(tsparams.LabelPreCacheTestCases), func()
}
})

It("tests for precache operator with multiple sources", func() {
// 48902 Tests image precaching - operators
It("tests for precache operator with multiple sources", reportxml.ID("48902"), func() {
var policies []string
for _, suffix := range suffixes {
policies = append(policies, tsparams.PolicyName+suffix)
Expand All @@ -84,7 +85,8 @@ var _ = Describe("TALM precache", Label(tsparams.LabelPreCacheTestCases), func()
Expect(errorList).To(BeEmpty(), "Failed to clean up test resources on hub")
})

It("tests for ocp cache with version", func() {
// 47950 Tests ocp upgrade with image precaching enabled
It("tests for ocp cache with version", reportxml.ID("47950"), func() {
By("creating and applying policy with clusterversion CR that defines the upgrade graph, channel, and version")
cguBuilder := getPrecacheCGU([]string{tsparams.PolicyName}, []string{RANConfig.Spoke1Name})

Expand Down Expand Up @@ -149,7 +151,8 @@ var _ = Describe("TALM precache", Label(tsparams.LabelPreCacheTestCases), func()
Expect(errList).To(BeEmpty(), "Failed to clean up test resources on hub")
})

It("tests for ocp cache with image", func() {
// 48903 Upgrade image precaching - OCP image with explicit image url
It("tests for ocp cache with image", reportxml.ID("48903"), func() {
By("creating and applying policy with clusterversion that defines the upgrade graph, channel, and version")
cguBuilder := getPrecacheCGU([]string{tsparams.PolicyName}, []string{RANConfig.Spoke1Name})

Expand Down Expand Up @@ -300,7 +303,8 @@ var _ = Describe("TALM precache", Label(tsparams.LabelPreCacheTestCases), func()
}
})

It("tests custom image precaching using an invalid image", func() {
// 64747 Precache Invalid User-Specified Image
It("tests custom image precaching using an invalid image", reportxml.ID("64747"), func() {
versionInRange, err := ranhelper.IsVersionStringInRange(RANConfig.HubOperatorVersions[ranparam.TALM], "4.14", "")
Expect(err).ToNot(HaveOccurred(), "Failed to compare TALM version string")

Expand Down

0 comments on commit 2a40983

Please sign in to comment.