diff --git a/Makefile b/Makefile index 565c05b..96edf2b 100644 --- a/Makefile +++ b/Makefile @@ -32,4 +32,7 @@ run-sub: dev-logs: docker logs mosquitto -f -.PHONEY: dev-logs \ No newline at end of file +.PHONEY: dev-logs + +test: + go test -v ./... \ No newline at end of file diff --git a/README.md b/README.md index de221c6..857516e 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ Learning MQTT with Golang by doing. This repo is a simple example of using a Gol ![mqtt-arch](./img/mqtt-architecture.svg) +Ideally I would like this application to resemble the above design. Conceptually, there + ## Development For local development we use [Mosquitto](https://mosquitto.org/) as our MQTT broker, with TLS enabled. @@ -17,7 +19,6 @@ For local development we use [Mosquitto](https://mosquitto.org/) as our MQTT bro sudo apt install mosquitto-clients ``` - First generate local development certs using: ``` @@ -38,6 +39,20 @@ Stop the local development environment with: make stop-dev ``` +### Testing + +Unit tests can be run with: + +``` +make test +``` + +Integration tests are run via: + +``` +make test-integration +``` + ## Usage *Instructions TBD* diff --git a/docker-compose.yaml b/docker-compose.yaml index bad8f73..caf1200 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,5 +1,3 @@ -version: "3.7" - services: mosquitto: image: eclipse-mosquitto:latest diff --git a/go.mod b/go.mod index 419dff4..71aa299 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,9 @@ module git.runcible.io/learning/learn_mqtt_go go 1.23.1 +require github.com/eclipse/paho.mqtt.golang v1.5.0 + require ( - github.com/eclipse/paho.mqtt.golang v1.5.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.7.0 // indirect