mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-13 21:30:04 +00:00
Add unit tests for HTTP dissector (#767)
* Add unit tests for HTTP dissector
* Ignore some fields on test environment
* Remove Git patches
* Don't have indent in the expected JSONs
* Fix more issues and update expected JSONs
* Refactor the test environment lookup
* Add a Makefile
* Include HTTP tests into the CI
* Fix the linting errors
* Fix another linting error
* Update the expected JSONs
* Sort `PostData.Params` params as well
* Move expected JSONs into `expect/dissect`
* Add `TestAnalyze` method
* Add `TestRepresent` method
* Add `TestRegister`, `TestMacros` and `TestPing` methods
* Test extensions first
* Remove expected JSONs
* Remove `bin` directory and update `Makefile` rules
* Update `.gitignore`
* Fix skipping download functionality in the Makefile
* Run `go mod tidy`
* Fix the race condition in the tests
* Revert "Test extensions first"
This reverts commit b8350cf139
.
* Make `TEST_UPDATE` env lookup one-liner
* Update .github/workflows/test.yml
Co-authored-by: gadotroee <55343099+gadotroee@users.noreply.github.com>
* Add a newline
* Replace `ls` with `find`
Co-authored-by: gadotroee <55343099+gadotroee@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/up9inc/mizu/tap/api"
|
||||
@@ -39,6 +40,10 @@ func mapSliceMergeRepeatedKeys(mapSlice []interface{}) (newMapSlice []interface{
|
||||
newMapSlice = append(newMapSlice, h)
|
||||
}
|
||||
|
||||
sort.Slice(newMapSlice, func(i, j int) bool {
|
||||
return newMapSlice[i].(map[string]interface{})["name"].(string) < newMapSlice[j].(map[string]interface{})["name"].(string)
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user