Skip to content

Commit

Permalink
addrundata reduce metadata to only fields testtracker cares about (op…
Browse files Browse the repository at this point in the history
  • Loading branch information
liulk authored and frasieroh committed Jul 26, 2023
1 parent 0221bad commit 8e83c0a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/addrundata/list_testtracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
// JSON. It optionally merges with an existing JSON if given. The JSON uses a
// proprietary schema for test tracker. See listJSON for a simpler schema.
func listTestTracker(w io.Writer, mergejson string, featuredir string, ts testsuite) error {
reduceMetadata(ts)
rootdir := filepath.Dir(featuredir)
ttp, ok := ttBuildPlan(ts, rootdir)
if !ok {
Expand Down Expand Up @@ -48,6 +49,18 @@ func listTestTracker(w io.Writer, mergejson string, featuredir string, ts testsu
return err
}

// reduceMetadata includes only the test metadata fields we care about for testtracker.
func reduceMetadata(ts testsuite) {
for _, tc := range ts {
md := tc.existing
tc.existing = &mpb.Metadata{
Uuid: md.Uuid,
PlanId: md.PlanId,
Description: md.Description,
}
}
}

// ttBuildPlan builds a hierarchical ttPlan from a flat testsuite. The ttPlan reorganizes
// the testsuite by splitting the test sections into ttSuite, and collates the different
// test kinds of the same test cases into the same ttCase.
Expand Down

0 comments on commit 8e83c0a

Please sign in to comment.