Skip to content

Commit

Permalink
add totalTests field in test file
Browse files Browse the repository at this point in the history
  • Loading branch information
palashmarantas committed Mar 30, 2022
1 parent de7c625 commit be8b87f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions pkg/service/teststats/teststats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,27 +246,29 @@ func TestProcStats_appendStatsToTestSuites(t *testing.T) {
}{
{"Test appendStatsToTests",
args{[]core.TestSuitePayload{
{SuiteID: "testSuite1", StartTime: timeMap["tpast1"], EndTime: timeMap["tfuture1"]},
{SuiteID: "testSuite1", StartTime: timeMap["tpast1"], EndTime: timeMap["tfuture1"], TotalTests: 0},
},
[]*procfs.Stats{}},
"[{SuiteID:testSuite1 SuiteName: ParentSuiteID: BlocklistSource: Blocklisted:false StartTime:2021-02-22 16:23:01 +0000 UTC EndTime:2021-02-22 16:23:01 +0000 UTC Duration:0 Status: Stats:[]}]",
"[{SuiteID:testSuite1 SuiteName: ParentSuiteID: BlocklistSource: Blocklisted:false StartTime:2021-02-22 16:23:01 +0000 UTC EndTime:2021-02-22 16:23:01 +0000 UTC Duration:0 Status: Stats:[] TotalTests:0}]",
},

{"Test appendStatsToTests",
args{[]core.TestSuitePayload{
{
SuiteID: "testSuite2",
StartTime: timeMap["tpast1"],
Duration: 100,
EndTime: timeMap["tfuture1"],
Stats: []core.TestProcessStats{},
SuiteID: "testSuite2",
StartTime: timeMap["tpast1"],
Duration: 100,
EndTime: timeMap["tfuture1"],
Stats: []core.TestProcessStats{},
TotalTests: 0,
},
{
SuiteID: "testSuite3",
StartTime: timeMap["tpast2"],
Duration: 200,
EndTime: timeMap["tfuture2"],
Stats: []core.TestProcessStats{{Memory: 100, CPU: 25.4, Storage: 250, RecordTime: timeMap["tpast2"]}},
SuiteID: "testSuite3",
StartTime: timeMap["tpast2"],
Duration: 200,
EndTime: timeMap["tfuture2"],
Stats: []core.TestProcessStats{{Memory: 100, CPU: 25.4, Storage: 250, RecordTime: timeMap["tpast2"]}},
TotalTests: 0,
},
},
[]*procfs.Stats{
Expand Down Expand Up @@ -296,7 +298,7 @@ func TestProcStats_appendStatsToTestSuites(t *testing.T) {
},
},
},
"[{SuiteID:testSuite2 SuiteName: ParentSuiteID: BlocklistSource: Blocklisted:false StartTime:2021-02-22 16:23:01 +0000 UTC EndTime:2021-02-22 16:23:01.1 +0000 UTC Duration:100 Status: Stats:[{Memory:131 CPU:1.2 Storage:0 RecordTime:2021-02-22 16:23:01 +0000 UTC}]} {SuiteID:testSuite3 SuiteName: ParentSuiteID: BlocklistSource: Blocklisted:false StartTime:2021-02-22 16:22:05 +0000 UTC EndTime:2021-02-22 16:22:05.2 +0000 UTC Duration:200 Status: Stats:[{Memory:100 CPU:25.4 Storage:250 RecordTime:2021-02-22 16:22:05 +0000 UTC}]}]",
"[{SuiteID:testSuite2 SuiteName: ParentSuiteID: BlocklistSource: Blocklisted:false StartTime:2021-02-22 16:23:01 +0000 UTC EndTime:2021-02-22 16:23:01.1 +0000 UTC Duration:100 Status: Stats:[{Memory:131 CPU:1.2 Storage:0 RecordTime:2021-02-22 16:23:01 +0000 UTC}] TotalTests:0} {SuiteID:testSuite3 SuiteName: ParentSuiteID: BlocklistSource: Blocklisted:false StartTime:2021-02-22 16:22:05 +0000 UTC EndTime:2021-02-22 16:22:05.2 +0000 UTC Duration:200 Status: Stats:[{Memory:100 CPU:25.4 Storage:250 RecordTime:2021-02-22 16:22:05 +0000 UTC}] TotalTests:0}]",
},
}
for _, tt := range tests {
Expand Down

0 comments on commit be8b87f

Please sign in to comment.