Skip to content

Commit 35c8ea4

Browse files
committed
update the rename mapping to take into account that suite information will not be removed from the name yet
make mapping update unit test
1 parent faf472a commit 35c8ea4

File tree

6 files changed

+1494
-6968
lines changed

6 files changed

+1494
-6968
lines changed

cmd/ci-test-mapping/map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ var mapCmd = &cobra.Command{
108108
var matched, unmatched int
109109
success := true
110110
for i := range tests {
111-
ownership, err := testIdentifier.Identify(tests[i])
111+
ownership, err := testIdentifier.Identify(&tests[i])
112112
if err != nil {
113113
log.WithError(err).Warningf("encountered error in component identification")
114114
success = false

data/openshift-gce-devel/ci_analysis_us/component_mapping.json

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/components/component.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ func NewTestIdentifier(reg *registry.Registry, componentIDs map[string]int64) *T
3939
}
4040
}
4141

42-
func (t *TestIdentifier) Identify(test v1.TestInfo) (*v1.TestOwnership, error) {
42+
func (t *TestIdentifier) Identify(test *v1.TestInfo) (*v1.TestOwnership, error) {
4343
var ownerships []*v1.TestOwnership
4444

4545
log.WithFields(testInfoLogFields(test)).Debugf("attempting to identify test using %d components", len(t.reg.Components))
4646
for name, component := range t.reg.Components {
4747
log.WithFields(testInfoLogFields(test)).Tracef("checking component %q", name)
48-
ownership, err := component.IdentifyTest(&test)
48+
ownership, err := component.IdentifyTest(test)
4949
if err != nil {
5050
log.WithError(err).Errorf("component %q returned an error", name)
5151
return nil, err
@@ -74,19 +74,19 @@ func (t *TestIdentifier) Identify(test v1.TestInfo) (*v1.TestOwnership, error) {
7474
return highestPriority, nil
7575
}
7676

77-
func (t *TestIdentifier) setDefaults(testInfo v1.TestInfo, testOwnership *v1.TestOwnership, c v1.Component) *v1.TestOwnership {
77+
func (t *TestIdentifier) setDefaults(testInfo *v1.TestInfo, testOwnership *v1.TestOwnership, c v1.Component) *v1.TestOwnership {
7878
// Kubernetes renames represent a global rename of tests that can belong to any (or no) components
7979
// They were renamed when openshift/kubernetes ceased the annotation of tests
8080
if newName, ok := KubernetesRenames[testInfo.Name]; ok {
81-
testInfo = v1.TestInfo{
81+
testInfo = &v1.TestInfo{
8282
Name: newName,
8383
Suite: testInfo.Suite,
8484
Variants: testInfo.Variants,
8585
}
8686
}
8787
if testOwnership.ID == "" {
8888
if c != nil {
89-
testOwnership.ID = util.StableID(testInfo, c.StableID(&testInfo))
89+
testOwnership.ID = util.StableID(testInfo, c.StableID(testInfo))
9090
} else {
9191
testOwnership.ID = util.StableID(testInfo, testInfo.Name)
9292
}
@@ -113,7 +113,7 @@ func (t *TestIdentifier) setDefaults(testInfo v1.TestInfo, testOwnership *v1.Tes
113113
}
114114

115115
if len(testOwnership.Capabilities) == 0 {
116-
capabilities := util.DefaultCapabilities(&testInfo)
116+
capabilities := util.DefaultCapabilities(testInfo)
117117
if len(capabilities) == 0 {
118118
capabilities = []string{DefaultCapability}
119119
}
@@ -127,7 +127,7 @@ func (t *TestIdentifier) setDefaults(testInfo v1.TestInfo, testOwnership *v1.Tes
127127
return testOwnership
128128
}
129129

130-
func testInfoLogFields(testInfo v1.TestInfo) log.Fields {
130+
func testInfoLogFields(testInfo *v1.TestInfo) log.Fields {
131131
return log.Fields{
132132
"name": testInfo.Name,
133133
"suite": testInfo.Suite,

0 commit comments

Comments
 (0)