File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,10 +50,6 @@ func TestJenkinsStagesDataFlow(t *testing.T) {
5050 dataflowTester .FlushTabler (& models.JenkinsBuild {})
5151 dataflowTester .ImportCsvIntoTabler ("./raw_tables/_tool_jenkins_builds_for_stages.csv" , models.JenkinsBuild {})
5252
53- // import tool table
54- dataflowTester .ImportCsvIntoTabler ("./snapshot_tables/_tool_jenkins_build_commits.csv" , models.JenkinsBuildCommit {})
55- dataflowTester .ImportCsvIntoTabler ("./snapshot_tables/cicd_tasks.csv" , devops.CICDTask {})
56-
5753 // verify extraction
5854 dataflowTester .FlushTabler (& models.JenkinsStage {})
5955 dataflowTester .Subtask (tasks .ExtractApiStagesMeta , taskData )
Original file line number Diff line number Diff line change @@ -99,7 +99,13 @@ func ConvertStages(taskCtx plugin.SubTaskContext) (err errors.Error) {
9999 if body .Name == "" {
100100 return nil , err
101101 }
102- durationSec := int64 (body .DurationMillis / 1000 )
102+ var durationMillis int
103+ if body .DurationMillis > 0 {
104+ durationMillis = body .DurationMillis
105+ } else {
106+ durationMillis = 0
107+ }
108+ durationSec := int64 (durationMillis / 1000 )
103109 jenkinsTaskResult := ""
104110 jenkinsTaskStatus := devops .STATUS_DONE
105111 var jenkinsTaskFinishedDate * time.Time
@@ -126,7 +132,7 @@ func ConvertStages(taskCtx plugin.SubTaskContext) (err errors.Error) {
126132 PipelineId : buildIdGen .Generate (body .ConnectionId , body .BuildName ),
127133 Result : jenkinsTaskResult ,
128134 Status : jenkinsTaskStatus ,
129- DurationSec : uint64 (body . DurationMillis / 1000 ),
135+ DurationSec : uint64 (durationMillis / 1000 ),
130136 StartedDate : startedDate ,
131137 FinishedDate : jenkinsTaskFinishedDate ,
132138 CicdScopeId : jobIdGen .Generate (body .ConnectionId , data .Options .JobFullName ),
You can’t perform that action at this time.
0 commit comments