Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions pkg/components/lpocp/capabilities.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package lpocp

import (
v1 "github.com/openshift-eng/ci-test-mapping/pkg/api/types/v1"
"github.com/openshift-eng/ci-test-mapping/pkg/util"
)

func identifyCapabilities(test *v1.TestInfo) []string {
capabilities := util.DefaultCapabilities(test)
return capabilities
}
57 changes: 57 additions & 0 deletions pkg/components/lpocp/component.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package lpocp

import (
"regexp"

v1 "github.com/openshift-eng/ci-test-mapping/pkg/api/types/v1"
"github.com/openshift-eng/ci-test-mapping/pkg/config"
)

type Component struct {
*config.Component
}

var LPocpComponent = Component{
Component: &config.Component{
Name: "LP--OCP",
Operators: []string{},
DefaultJiraComponent: "LP--OCP",
Matchers: []config.ComponentMatcher{
{SuiteRegEx: regexp.MustCompile(`^lp-chaos--OCP--`)},
},
},
}

func (c *Component) IdentifyTest(test *v1.TestInfo) (*v1.TestOwnership, error) {
if matcher := c.FindMatch(test); matcher != nil {
jira := matcher.JiraComponent
if jira == "" {
jira = c.DefaultJiraComponent
}
return &v1.TestOwnership{
Name: test.Name,
Component: c.Name,
JIRAComponent: jira,
Priority: matcher.Priority,
Capabilities: append(matcher.Capabilities, identifyCapabilities(test)...),
}, nil
}

return nil, nil
}

func (c *Component) StableID(test *v1.TestInfo) string {
if stableName, ok := c.TestRenames[test.Name]; ok {
return stableName
}
return test.Name
}

func (c *Component) JiraComponents() (components []string) {
components = []string{c.DefaultJiraComponent}
for _, m := range c.Matchers {
components = append(components, m.JiraComponent)
}

return components
}
2 changes: 2 additions & 0 deletions pkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ import (
"github.com/openshift-eng/ci-test-mapping/pkg/components/lpgitops"
"github.com/openshift-eng/ci-test-mapping/pkg/components/lpmta"
"github.com/openshift-eng/ci-test-mapping/pkg/components/lpoadp"
"github.com/openshift-eng/ci-test-mapping/pkg/components/lpocp"
"github.com/openshift-eng/ci-test-mapping/pkg/components/lpodf"
"github.com/openshift-eng/ci-test-mapping/pkg/components/lpopenshiftpipelines"
"github.com/openshift-eng/ci-test-mapping/pkg/components/lpquay"
Expand Down Expand Up @@ -448,6 +449,7 @@ func NewComponentRegistry() *Registry {
r.Register("service-ca", &serviceca.ServiceCaComponent)
r.Register("spire-operator", &spireoperator.SpireOperatorComponent)
r.Register("LP--CNV", &lpcnv.LPcnvComponent)
r.Register("LP--OCP", &lpocp.LPocpComponent)
r.Register("eBPF Manager", &ebpfmanager.EBPFManagerComponent)
r.Register("External Secrets Operator", &externalsecretsoperator.ExternalSecretsOperatorComponent)
r.Register("JobSet", &jobset.JobSetComponent)
Expand Down