From eed5404699cb592df9c10fc47887006fb11e577c Mon Sep 17 00:00:00 2001 From: Gourav kumar <44055698+gouravkrosx@users.noreply.github.com> Date: Tue, 23 Apr 2024 15:18:48 +0530 Subject: [PATCH] fix: add keploy-test-id header to noisy field in abs match (#1847) * chore: add keploy-test-id header to noisy field in abs match Signed-off-by: gouravkrosx * chore: remove name comparison in absmatch Signed-off-by: gouravkrosx --------- Signed-off-by: gouravkrosx --- pkg/service/replay/absmatch.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/service/replay/absmatch.go b/pkg/service/replay/absmatch.go index 6932d92c3..1bdf02a60 100644 --- a/pkg/service/replay/absmatch.go +++ b/pkg/service/replay/absmatch.go @@ -47,11 +47,10 @@ func AbsMatch(tcs1, tcs2 *models.TestCase, noiseConfig map[string]map[string][]s pass = false } - //compare name + //compare name (just for debugging) if tcs1.Name != tcs2.Name { nameResult.Normal = false logger.Debug("test case name is not equal", zap.Any("tcs1Name", tcs1.Name), zap.Any("tcs2Name", tcs2.Name)) - pass = false } //compare curl @@ -76,6 +75,7 @@ func AbsMatch(tcs1, tcs2 *models.TestCase, noiseConfig map[string]map[string][]s pass = false } + absResult.Name = nameResult absResult.Kind = kindResult absResult.Req = reqCompare absResult.Resp = respCompare @@ -157,6 +157,7 @@ func CompareHTTPReq(tcs1, tcs2 *models.TestCase, _ models.GlobalNoise, ignoreOrd } reqHeaderNoise := map[string][]string{} + reqHeaderNoise["Keploy-Test-Id"] = []string{} // compare http req headers ok := CompareHeaders(pkg.ToHTTPHeader(tcs1.HTTPReq.Header), pkg.ToHTTPHeader(tcs2.HTTPReq.Header), &reqCompare.HeaderResult, reqHeaderNoise) @@ -422,6 +423,7 @@ func CompareCurl(curl1, curl2 string, logger *zap.Logger) bool { } curlHeaderNoise := map[string][]string{} + curlHeaderNoise["Keploy-Test-Id"] = []string{} hres := []models.HeaderResult{} ok := CompareHeaders(pkg.ToHTTPHeader(headers1), pkg.ToHTTPHeader(headers2), &hres, curlHeaderNoise)