-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the compliance history API tests
The tech preview feature is being removed so the tests are no longer needed. Relates: https://issues.redhat.com/browse/ACM-15291 https://issues.redhat.com/browse/ACM-13208 Signed-off-by: mprahl <[email protected]>
- Loading branch information
1 parent
0ed8dc4
commit 8bca75b
Showing
13 changed files
with
60 additions
and
1,718 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright Contributors to the Open Cluster Management project | ||
|
||
package integration | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" | ||
|
||
"github.com/stolostron/governance-policy-framework/test/common" | ||
) | ||
|
||
func verifyPolicyOnAllClusters( | ||
ctx context.Context, namespace string, policy string, compliance string, timeout int, | ||
) ( | ||
clusters []string, | ||
) { | ||
GinkgoHelper() | ||
|
||
By(fmt.Sprintf("Verifying that the policy %s/%s is %s", namespace, policy, compliance)) | ||
|
||
Eventually(func(g Gomega) { | ||
clusters = confirmComplianceOnAllClusters(ctx, namespace, policy, compliance)(g) | ||
}, timeout, 1).Should(Succeed()) | ||
|
||
return | ||
} | ||
|
||
func confirmComplianceOnAllClusters( | ||
ctx context.Context, namespace string, policy string, compliance string, | ||
) func(g Gomega) []string { | ||
return func(g Gomega) []string { | ||
GinkgoHelper() | ||
|
||
clusters := []string{} | ||
|
||
parentPolicy, err := clientHubDynamic.Resource(common.GvrPolicy).Namespace(namespace).Get( | ||
ctx, policy, metav1.GetOptions{}, | ||
) | ||
g.Expect(err).ToNot(HaveOccurred()) | ||
|
||
perClusterStatus, _, _ := unstructured.NestedSlice(parentPolicy.Object, "status", "status") | ||
g.Expect(perClusterStatus).ToNot(BeEmpty(), "no cluster status was available on the parent policy") | ||
|
||
for _, clusterStatus := range perClusterStatus { | ||
clusterStatus, ok := clusterStatus.(map[string]interface{}) | ||
g.Expect(ok).To(BeTrue(), "the cluster status was not the right type") | ||
|
||
g.Expect(clusterStatus["compliant"]).To(Equal(compliance)) | ||
g.Expect(clusterStatus["clustername"]).ToNot(BeEmpty()) | ||
clusters = append(clusters, clusterStatus["clustername"].(string)) | ||
} | ||
|
||
return clusters | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
105 changes: 0 additions & 105 deletions
105
test/resources/compliance_history/compliance-api-prerequisites.yaml
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
test/resources/compliance_history/operator-policy-invalid.yaml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.