Skip to content

Commit

Permalink
fix: add keploy-test-id header to noisy field in abs match (#1847)
Browse files Browse the repository at this point in the history
* chore: add keploy-test-id header to noisy field in abs match

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

* chore: remove name comparison in absmatch

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

---------

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
  • Loading branch information
gouravkrosx committed Apr 23, 2024
1 parent 72d744e commit eed5404
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/service/replay/absmatch.go
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit eed5404

Please sign in to comment.