name: MQTT External Tests on: [pull_request] permissions: contents: read jobs: test: env: GOPATH: /home/runner/work/nats-server GO111MODULE: "on" runs-on: ${{ vars.GHA_WORKER_SMALL || 'ubuntu-latest' }} steps: - name: Checkout code uses: actions/checkout@v6 with: path: src/github.com/nats-io/nats-server - name: Setup Go uses: actions/setup-go@v6 with: go-version: stable cache-dependency-path: src/github.com/nats-io/nats-server/go.sum - name: Set up testing tools and environment shell: bash --noprofile --norc -eo pipefail {0} id: setup run: | wget https://github.com/hivemq/mqtt-cli/releases/download/v4.20.0/mqtt-cli-4.20.0.deb sudo apt install ./mqtt-cli-4.20.0.deb # Pinned to the mqtt-test commit that adds --pipeline (PR #5); # bump to @v0.2.0 once it is tagged. go install github.com/ConnectEverything/mqtt-test@6138352776422dfd16eeb3333d078358d8b85fea - name: Run tests (3 times to detect flappers) shell: bash --noprofile --norc -eo pipefail {0} run: | cd src/github.com/nats-io/nats-server go test -v --count=3 --run='TestXMQTT' ./server - name: Run tests with --race shell: bash --noprofile --norc -eo pipefail {0} run: | cd src/github.com/nats-io/nats-server go test -v --race --failfast --run='TestXMQTT' ./server - name: Run benchmarks shell: bash --noprofile --norc -eo pipefail {0} run: | cd src/github.com/nats-io/nats-server go test --run='-' --count=3 --bench 'BenchmarkXMQTT' --benchtime=100x ./server # TODO: compare benchmarks