Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) {
ret := []*junitapi.JUnitTestCase{}

testName := "[sig-arch][Late] operators should not create watch channels very often"
testMinRequestsName := "[sig-arch][Late] operators should have watch channel requests"
oc := exutil.NewCLIWithoutNamespace("operator-watch")
infra, err := oc.AdminConfigClient().ConfigV1().Infrastructures().Get(context.Background(), "cluster", metav1.GetOptions{})
if err != nil {
Expand All @@ -153,6 +154,15 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) {
},
)

ret = append(ret, &junitapi.JUnitTestCase{
Name: testMinRequestsName,
FailureOutput: &junitapi.FailureOutput{
Message: err.Error(),
Output: err.Error(),
},
},
)

return ret, nil
}

Expand Down Expand Up @@ -376,27 +386,69 @@ func (s *watchCountTracking) CreateJunits() ([]*junitapi.JUnitTestCase, error) {
}

var upperBound platformUpperBound
if infra.Status.ControlPlaneTopology == configv1.SingleReplicaTopologyMode {

switch infra.Status.ControlPlaneTopology {
case configv1.ExternalTopologyMode:
return []*junitapi.JUnitTestCase{{
Name: testName,
SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported topology: %v", infra.Status.ControlPlaneTopology)},
}, {
Name: testMinRequestsName,
SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported topology: %v", infra.Status.ControlPlaneTopology)},
}}, nil

case configv1.SingleReplicaTopologyMode:
if _, exists := upperBoundsSingleNode[infra.Spec.PlatformSpec.Type]; !exists {
return []*junitapi.JUnitTestCase{{
Name: testName,
SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported single node platform type: %v", infra.Spec.PlatformSpec.Type)},
}, {
Name: testMinRequestsName,
SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported single node platform type: %v", infra.Spec.PlatformSpec.Type)},
}}, nil

}
upperBound = upperBoundsSingleNode[infra.Spec.PlatformSpec.Type]
} else {

default:
if _, exists := upperBounds[infra.Spec.PlatformSpec.Type]; !exists {
return []*junitapi.JUnitTestCase{{
Name: testName,
SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported platform type: %v", infra.Spec.PlatformSpec.Type)},
}, {
Name: testMinRequestsName,
SkipMessage: &junitapi.SkipMessage{Message: fmt.Sprintf("unsupported platform type: %v", infra.Spec.PlatformSpec.Type)},
}}, nil
}
upperBound = upperBounds[infra.Spec.PlatformSpec.Type]
}

watchRequestCounts := s.SummarizeWatchCountRequests()

if len(watchRequestCounts) == 0 {
ret = append(ret,
&junitapi.JUnitTestCase{
Name: testMinRequestsName,
FailureOutput: &junitapi.FailureOutput{
Message: "Expected at least one watch request count to be present",
},
},
)
// flake for now
ret = append(ret,
&junitapi.JUnitTestCase{
Name: testMinRequestsName,
},
)

} else {
ret = append(ret,
&junitapi.JUnitTestCase{
Name: testMinRequestsName,
},
)
}

operatorBoundExceeded := []string{}
for _, item := range watchRequestCounts {
operator := strings.Split(item.Operator, ":")[3]
Expand Down