You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I keep sending this email and answering similar questions. We need to add something like this to doc:
NATS and CI/CD
Running NATS in your CI/CD environment is fairly straightforward. The NATS server is so lightweight it's really easy to spin up and test with, for example in .NET we can run about 500 tests in under 7 minutes in azure pipelines with almost every test launching a server instance.
Installing the NATS Server
To setup CI with the latest NATS server you have a few options - you can build or run our nightly docker image.
I keep sending this email and answering similar questions. We need to add something like this to doc:
NATS and CI/CD
Running NATS in your CI/CD environment is fairly straightforward. The NATS server is so lightweight it's really easy to spin up and test with, for example in .NET we can run about 500 tests in under 7 minutes in azure pipelines with almost every test launching a server instance.
Installing the NATS Server
To setup CI with the latest NATS server you have a few options - you can build or run our nightly docker image.
To build: https://github.com/nats-io/nats.java/blob/master/install_deps.sh
Docker: $ docker run -p 4222:4222 synadia/nats-server:nightly
For past releases you can unzip a tar file from github and use an official release, but you won't have edge features.
Or just use github actions if you are in a github environment:
https://github.com/nats-io/jetstream-gh-action
NATS Server test helpers and Usage
Test helpers vary client to client. Here are some examples.
Java
Here is the class you can copy to run the NATS server from java:
https://github.com/nats-io/nats.java/blob/master/src/test/java/io/nats/client/NatsTestServer.java
Example tests:
https://github.com/nats-io/nats.java/blob/master/src/test/java/io/nats/client/JetstreamTests.java
Node.js
https://github.com/nats-io/nats.js/blob/master/test/support/nats_server_control.js
and usage:
https://github.com/nats-io/nats.js/blob/master/test/basics.js#L32
Others
(add .NET, deno, C, python, etc).
Check out each NATS client repository's CI/CD workflow for hints as to run the NATS server CI/CD in your environment.
The text was updated successfully, but these errors were encountered: