Skip to content

Commit

Permalink
chore clean-up tests to latest ginko version
Browse files Browse the repository at this point in the history
  • Loading branch information
pentateu committed May 16, 2021
1 parent af0c531 commit e3f48e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
6 changes: 2 additions & 4 deletions registry/nodeService_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ func findBy(field, value string, list []moleculer.Payload) []map[string]interfac

var _ = Describe("nodeService", func() {
Describe("Local Service $node", func() {
harness := func(action string, scenario string, params map[string]interface{}, transformer func(interface{}) interface{}) func(done Done) {
harness := func(action string, scenario string, params map[string]interface{}, transformer func(interface{}) interface{}) func() {
label := fmt.Sprint(scenario, "-", action)
return func(done Done) {
return func() {
mem := &memory.SharedMemory{}

printerBroker := createPrinterBroker(mem)
Expand Down Expand Up @@ -101,8 +101,6 @@ var _ = Describe("nodeService", func() {
result = <-cpuBroker.Call(action, params)
Expect(result.Exists()).Should(BeTrue())
Expect(snap.SnapshotMulti(fmt.Sprint(label, "cpuBroker"), transformer(result))).Should(Succeed()) //failed here perdeu o node priunter

close(done)
}
}

Expand Down
10 changes: 4 additions & 6 deletions registry/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ var _ = Describe("Registry", func() {

Describe("Auto discovery", func() {
//failed with timeout
It("3 brokers should auto discovery and perform local and remote Calls", func(done Done) {
It("3 brokers should auto discovery and perform local and remote Calls", func() {
mem := &memory.SharedMemory{}
printerBroker := createPrinterBroker(mem)
var serviceAdded, serviceRemoved []moleculer.Payload
Expand Down Expand Up @@ -260,13 +260,12 @@ var _ = Describe("Registry", func() {
<-scannerBroker.Call("scanner.scan", scanText)
}).Should(Panic()) //broker B is stopped ... so it should panic

close(done)
}, 5)
})
})

Describe("Namespace", func() {

It("Services across namespaces cannos see each other", func(done Done) {
It("Services across namespaces cannos see each other", func() {

mem := &memory.SharedMemory{}

Expand Down Expand Up @@ -380,7 +379,6 @@ var _ = Describe("Registry", func() {
stageBroker.Stop()
stage2Broker.Stop()

close(done)
}, 2)
})
})
})
10 changes: 4 additions & 6 deletions transit/nats/nats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var _ = Describe("NATS Streaming Transit", func() {

})

It("should make a remote call from profile broker a to user broker", func(done Done) {
It("should make a remote call from profile broker a to user broker", func() {
userBroker.Start()
profileBroker.Start()
profileBroker.WaitFor("user")
Expand All @@ -79,10 +79,9 @@ var _ = Describe("NATS Streaming Transit", func() {

userBroker.Stop()
profileBroker.Stop()
close(done)
}, 3)
})

It("should fail after brokers are stopped", func(done Done) {
It("should fail after brokers are stopped", func() {
userBroker.Start()
profileBroker.Start()

Expand All @@ -93,8 +92,7 @@ var _ = Describe("NATS Streaming Transit", func() {
Expect((<-profileBroker.Call("user.update", longList)).IsError()).Should(BeTrue())

profileBroker.Stop()
close(done)
}, 3)
})
})

Describe("Start / Stop Cycles.", func() {
Expand Down

0 comments on commit e3f48e1

Please sign in to comment.