From d01a6c05d3805e8f6ca2041f2079f8c3bcea30c9 Mon Sep 17 00:00:00 2001 From: Andreas Weber Date: Wed, 10 Apr 2024 20:59:35 +0200 Subject: [PATCH] fix: prevent override of previous test results with region in loop (#664) --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/plugins/core/execute/processedHttpRegionInterceptor.ts | 5 ++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 683733a5..9e4498d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [6.12.2] +### Fix +- test results generated by `@loop` override previous test results for junit output(#664) + ## [6.12.1] ### Fix - provide no duplicate symbols on filter call (Anweber/vscode-httpyac#269) diff --git a/package-lock.json b/package-lock.json index c841bd9a..217072a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "httpyac", - "version": "6.12.1", + "version": "6.12.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "httpyac", - "version": "6.12.1", + "version": "6.12.2", "license": "MIT", "dependencies": { "@cloudamqp/amqp-client": "^2.1.1", diff --git a/package.json b/package.json index 8679cc2e..a393379b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "license": "MIT", "publisher": "AnWeber", "description": "HTTP/REST CLI Client for *.http files", - "version": "6.12.1", + "version": "6.12.2", "homepage": "https://github.com/AnWeber/httpyac", "repository": { "type": "git", diff --git a/src/plugins/core/execute/processedHttpRegionInterceptor.ts b/src/plugins/core/execute/processedHttpRegionInterceptor.ts index d2fa7186..6055c1f8 100644 --- a/src/plugins/core/execute/processedHttpRegionInterceptor.ts +++ b/src/plugins/core/execute/processedHttpRegionInterceptor.ts @@ -31,7 +31,10 @@ export class ProcessedHttpRegionInterceptor implements HookInterceptor<[models.P ): Promise { const [context] = hookContext.args; - const processedHttpRegion = context.processedHttpRegions?.find(obj => obj.id === context.httpRegion.id); + const processedHttpRegion = context.processedHttpRegions + ?.slice() + .reverse() + ?.find(obj => obj.id === context.httpRegion.id); if (processedHttpRegion) { processedHttpRegion.end = performance.now(); processedHttpRegion.duration = processedHttpRegion.end - processedHttpRegion.start;