Add an Azure Service Bus Emulator module
Adds a module for the Azure Service Bus Emulator. Based heavily on the Go implemenatation.
I have a few open questions:
- Go has a single
azuremodule encapsulating multiple Azure services including the emulator, should this be replicated innode? - The Service Bus Emulator depends on an MSSQL Server instance, of which a module already exists. We could re-use the module, but currently there are no other modules that depend on each other. I've copy-pasted the MSSQL container, but I'm certain this should be done differently
- The emulator exposes ports
5672and5300, but for some reason the port wait strategy never recognizes these as bound. This seems to be working fine in Go, I'm not sure what the difference is here. I've omitted the port strategy currently but this should probably be added back
Resolves #1082
Deploy Preview for testcontainers-node ready!
| Name | Link |
|---|---|
| Latest commit | 6c3d3c114c503824688b8146fa7a27c55de2f642 |
| Latest deploy log | https://app.netlify.com/projects/testcontainers-node/deploys/693ca68591766600078b931f |
| Deploy Preview | https://deploy-preview-1194--testcontainers-node.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Thanks for raising the PR @UnstoppableMango, I'm a bit swamped at the moment but will look into it as soon as I can
Nice looks great! Excited to give it a try :) :)
@UnstoppableMango:
- Single azure module vs multiple: I would have preferred a single module, like we have for gcloud, but unfortunately we already have azurecosmosdb as a separate module. I'm leaning towards making this a separate module (as you have already), and in the future we'll release a major version which unifies them into a single azure module
- Dependency on MSSQL server container: As the maintainer it pains me to duplicate code, but I am also leaning towards copy/pasting the MSSQL container - it'll make the dependency constraints between modules quite complex otherwise. Let's aim to keep the MSSQL container as minimal as possible to minimize maintenance effort, it shouldn't need all the features of the standalone one right?
- Port wait strategy not working: This one needs more looking at - if you were to debug at the point the container has started, are you able to for example netcat the container ports?
Thanks for raising the PR, it's already in very good condition!
Alright, I refactored the MSSQL container into a generic container so it's no longer a copy-paste of the module. I also added a test to demonstrate that the user needs to manually configure the SA password when using a custom container.
I did some more debugging around the ports and I think the problem is really that the emulator image is minimal and doesn't contain any tools, including a shell like sh. The Go module has this same problem, but the wait logic appears to ignore missing shells and drop the error.
I was able to work around this by extending the emulator image to install sh and nc, but that feels overkill to me. Open to suggestions, but perhaps the health check wait strategy is enough?
@UnstoppableMango please check the review comments. Apart from the password strength (I guess it's fine considering the container starts?), I think they're all somewhat valid