Pārlūkot izejas kodu

fix: api test 流水线记录字段名字,流水线记录判空

370774330@qq.com 5 gadi atpakaļ
vecāks
revīzija
412fc78bb2

+ 3 - 0
web/src/main/java/cn/seecoder/web/service/impl/func_test/FuncFuncTestServiceImpl.java

@@ -157,6 +157,9 @@ public class FuncFuncTestServiceImpl implements FuncTestService {
             return new ArrayList<>();
         }
         PipelineRecordPO latestRecord = pipelineRecordMapper.selectPipelinesLatestRecord(pipelineIds);
+        if (latestRecord == null){
+            return new ArrayList<>();
+        }
         return funcTestRecordMapper.selectByPipelineHistoryId(latestRecord.getId()).stream()
                 .map(x->{
                     FuncTestRecordVO vo = new FuncTestRecordVO();

+ 10 - 10
web/src/main/resources/sql/table_init.sql

@@ -123,17 +123,17 @@ create table if not exists devcloud.test_info
 
 create table if not exists devcloud.test_result
 (
-    id                  int auto_increment
+    id                 int auto_increment
         primary key,
-    test_id             int           not null,
-    execute_time        datetime      not null,
-    success             int default 0 not null,
-    failure             int default 0 not null,
-    time_list           text          not null,
-    max_time            int           not null,
-    min_time            int           not null,
-    average_time        double        not null,
-    pipeline_history_id int           null
+    test_id            int           not null,
+    execute_time       datetime      not null,
+    success            int default 0 not null,
+    failure            int default 0 not null,
+    time_list          text          not null,
+    max_time           int           not null,
+    min_time           int           not null,
+    average_time       double        not null,
+    pipeline_record_id int           null
 );
 
 create table if not exists devcloud.tree_node