From 07f9a08275524d1ea68878144717dda95215e8d7 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 22 May 2023 18:48:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20[?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95]github#24464=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E4=BF=AE=E6=94=B9csv=20=E6=96=87=E4=BB=B6=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E6=80=A7=E8=83=BD=E9=87=8C=E7=82=B9=E5=87=BB=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=9C=BA=E6=99=AF=E8=AE=BE=E7=BD=AE=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=EF=BC=8C=E9=A1=B5=E9=9D=A2csv=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=9C=AA=E5=88=B7=E6=96=B0=E8=BF=87=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【[性能测试]github#24464场景修改csv 文件后,性能里点击同步场景设置最新变更,页面csv 文件未刷新过来】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001026339 --- .../api/service/ApiPerformanceService.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/performance-test/backend/src/main/java/io/metersphere/api/service/ApiPerformanceService.java b/performance-test/backend/src/main/java/io/metersphere/api/service/ApiPerformanceService.java index 827b0a391a..74637b97e4 100644 --- a/performance-test/backend/src/main/java/io/metersphere/api/service/ApiPerformanceService.java +++ b/performance-test/backend/src/main/java/io/metersphere/api/service/ApiPerformanceService.java @@ -9,6 +9,7 @@ import io.metersphere.base.mapper.ext.ExtApiLoadTestMapper; import io.metersphere.base.mapper.ext.ExtLoadTestMapper; import io.metersphere.commons.constants.MicroServiceName; import io.metersphere.commons.constants.PerformanceTestStatus; +import io.metersphere.commons.constants.StorageConstants; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.FileUtils; import io.metersphere.commons.utils.LogUtil; @@ -16,12 +17,12 @@ import io.metersphere.i18n.Translator; import io.metersphere.metadata.service.FileMetadataService; import io.metersphere.request.EditTestPlanRequest; import io.metersphere.service.MicroService; +import jakarta.annotation.Resource; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import jakarta.annotation.Resource; import java.io.File; import java.nio.charset.StandardCharsets; import java.util.List; @@ -166,9 +167,13 @@ public class ApiPerformanceService { private void saveOtherFile(List fileNames, String loadTestId) { for (int i = 0; i < fileNames.size(); i++) { FileMetadata model = fileNames.get(i); - String fileName = model.getName(); - File file = FileUtils.getFileByName(fileName); - saveUploadFile(file, loadTestId, i + 1); + if (StringUtils.equalsAnyIgnoreCase(model.getStorage(), StorageConstants.GIT.name(), StorageConstants.MINIO.name())) { + saveLoadTestFile(model, loadTestId, i + 1); + } else { + String fileName = model.getName(); + File file = FileUtils.getFileByName(fileName); + saveUploadFile(file, loadTestId, i + 1); + } } }