mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-20 01:19:35 +00:00
* Basenine MongoDB mess
* Fix more
* Fix the `mongodb` container arguments
* Add Basenine ARM64 binary
* Make the changes related to `leftOff` becoming a string value
* Make `leftOffTop` state string
* Handle `CloseConnection` in `Fetch`
* Upgrade Basenine to `0.7.0`
* Revert the changes in `package.json` and `package-lock.json`
* Fix the `Dockerfile`
* Remove the binaries
* Increase the Basenine up deadline to 20 seconds
* Revert the changes in `shared/kubernetes/provider.go`
* Fix the OAS generator tests
* Protect from race condition
* Fix mutexes
* Fix unlock
* Fix logging data types
* Try to stabilize the tests
* Remove the `replace` statement
* revert the change the done in 2899414f2b
to not change the leftOff
* Change `leftOffBottom` empty string default value to `latest`
* Upgrade Basenine to `0.7.1`
* Handle the Basenine client library errors better
* Use `DEFAULT_QUERY` constant
* Remove `min=-1`
* Replace some `Errorf`s with `Panicf`s
* Remove the closure in `runGenerator` method
* Remove an unnecessary check
Co-authored-by: M. Mert Yildiran <mehmet@up9.com>
Co-authored-by: Andrey Pokhilko <apc4@ya.ru>
Co-authored-by: undera <undera@undera-old-desktop.home>
Co-authored-by: AmitUp9 <96980485+AmitUp9@users.noreply.github.com>
47 lines
972 B
Go
47 lines
972 B
Go
package oas
|
|
|
|
import (
|
|
"encoding/json"
|
|
"github.com/up9inc/mizu/agent/pkg/har"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestOASGen(t *testing.T) {
|
|
gen := new(defaultOasGenerator)
|
|
|
|
e := new(har.Entry)
|
|
err := json.Unmarshal([]byte(`{"startedDateTime": "20000101","request": {"url": "https://host/path", "method": "GET"}, "response": {"status": 200}}`), e)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
ews := &EntryWithSource{
|
|
Destination: "some",
|
|
Entry: *e,
|
|
}
|
|
|
|
dummyConn := GetFakeDBConn(`{"startedDateTime": "20000101","request": {"url": "https://host/path", "method": "GET"}, "response": {"status": 200}}`)
|
|
gen.Start(dummyConn)
|
|
gen.handleHARWithSource(ews)
|
|
g, ok := gen.serviceSpecs.Load("some")
|
|
if !ok {
|
|
panic("Failed")
|
|
}
|
|
sg := g.(*SpecGen)
|
|
spec, err := sg.GetSpec()
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
specText, _ := json.Marshal(spec)
|
|
t.Log(string(specText))
|
|
|
|
if !gen.IsStarted() {
|
|
t.Errorf("Should be started")
|
|
}
|
|
|
|
time.Sleep(100 * time.Millisecond)
|
|
|
|
gen.Stop()
|
|
}
|