Start crossbar.io programmatically

125 Views Asked by At

Objective

I am have a simple publish server (in nodejs, using autobahn.js) that receives data from a machine and then publishes it to interested subscribers.

I am currently doing integration tests and I need to know:

  • If crossbar is running, I need to test if the server is able to successfully connect to it
  • If not, I need to launch crossbar, run the previous test, and then kill crossbar

Problem

As far as I know, there is not way to either detect if crossbar is running, or to launch it from code. Furthermore my research led me to this github issue:

Which makes me believe that running integration tests with crossbar, if not impossible, needs a relative elaborated workaround.

Questions

  1. Is there a way to start and test if crossbar is running programmatically?
  2. If not, how do you perform integration tests with crossbar?
1

There are 1 best solutions below

0
On BEST ANSWER

Answers

After getting a reply for the owner of autobhan, the following is now clear:

A1. It is not possible to launch crossbar programmatically. A2. You don't. The suggestion is to launch a client and if something fails handle the error...

Conclusion/Venting

I am fairly disappointed. They keep mentioning Docker as if a container platform would be necessary in doing TDD at the level of mocha. Mind blowing if you ask me.

The only way to do any sort of testing is to either manually run the crossbar commands, or have your tests interact with a manually written script.