(t *testing.T)
| 25 | ) |
| 26 | |
| 27 | func TestRuntimeMap(t *testing.T) { |
| 28 | rtMap := NewRuntimeManager(getFuncletNode(), &RuntimeManagerParameters{MaxRuntimeIdle: 10, MaxRunnerDefunct: 30}) |
| 29 | rtParams := &NewRuntimeParameters{ |
| 30 | RuntimeID: "aa", |
| 31 | ConcurrentMode: false, |
| 32 | StreamMode: false, |
| 33 | WaitRuntimeAliveTimeout: 3, |
| 34 | Resource: &api.Resource{}, |
| 35 | } |
| 36 | rt := rtMap.NewRuntime(rtParams) |
| 37 | if rt == nil { |
| 38 | t.Error("create runtime aa failed.") |
| 39 | } |
| 40 | rt2 := rtMap.NewRuntime(rtParams) |
| 41 | if rt2 != nil { |
| 42 | t.Error("create runtime with same id") |
| 43 | } |
| 44 | |
| 45 | rt, err := rtMap.GetRuntime("aa") |
| 46 | if err != nil { |
| 47 | t.Errorf("invalid runtime with id %s", "aa") |
| 48 | } |
| 49 | rtlist := rtMap.RuntimeList() |
| 50 | if len(rtlist) == 0 { |
| 51 | t.Error("runtime list error") |
| 52 | } |
| 53 | rtMap.DelRuntime("aa") |
| 54 | } |
| 55 | |
| 56 | func TestRuntimeInfo(t *testing.T) { |
| 57 | rtParams := &NewRuntimeParameters{ |
nothing calls this directly
no test coverage detected